Git Product home page Git Product logo

react-use-cart's Introduction

react-use-cart

🛒 A lightweight shopping cart hook for React, Next.js, and Gatsby

Version Downloads/week License Forks on GitHub Forks on GitHub minified + gzip size Contributors

Why?

  • Bundle size
  • No dependencies
  • 💳 Not tied to any payment gateway, or checkout - create your own!
  • 🔥 Persistent carts with local storage, or your own adapter
  • ⭐️ Supports multiples carts per page
  • 🛒 Flexible cart item schema
  • 🥞 Works with Next, Gatsby, React
  • ♻️ Trigger your own side effects with cart handlers (on item add, update, remove)
  • 🛠 Built with TypeScript
  • ✅ Fully tested
  • 🌮 Used by Dines

Quick Start

Demo

import { CartProvider, useCart } from "react-use-cart";

function Page() {
  const { addItem } = useCart();

  const products = [
    {
      id: 1,
      name: "Malm",
      price: 9900,
      quantity: 1
    },
    {
      id: 2,
      name: "Nordli",
      price: 16500,
      quantity: 5
    },
    {
      id: 3,
      name: "Kullen",
      price: 4500,
      quantity: 1
    },
  ];

  return (
    <div>
      {products.map((p) => (
        <div key={p.id}>
          <button onClick={() => addItem(p)}>Add to cart</button>
        </div>
      ))}
    </div>
  );
}

function Cart() {
  const {
    isEmpty,
    totalUniqueItems,
    items,
    updateItemQuantity,
    removeItem,
  } = useCart();

  if (isEmpty) return <p>Your cart is empty</p>;

  return (
    <>
      <h1>Cart ({totalUniqueItems})</h1>

      <ul>
        {items.map((item) => (
          <li key={item.id}>
            {item.quantity} x {item.name} &mdash;
            <button
              onClick={() => updateItemQuantity(item.id, item.quantity - 1)}
            >
              -
            </button>
            <button
              onClick={() => updateItemQuantity(item.id, item.quantity + 1)}
            >
              +
            </button>
            <button onClick={() => removeItem(item.id)}>&times;</button>
          </li>
        ))}
      </ul>
    </>
  );
}

function App() {
  return (
    <CartProvider>
      <Page />
      <Cart />
    </CartProvider>
  );
}

Install

npm install react-use-cart # yarn add react-use-cart

CartProvider

You will need to wrap your application with the CartProvider component so that the useCart hook can access the cart state.

Carts are persisted across visits using localStorage, unless you specify your own storage adapter.

Usage

import React from "react";
import ReactDOM from "react-dom";
import { CartProvider } from "react-use-cart";

ReactDOM.render(
  <CartProvider>{/* render app/cart here */}</CartProvider>,
  document.getElementById("root")
);

Props

Prop Required Description
id No id for your cart to enable automatic cart retrieval via window.localStorage. If you pass a id then you can use multiple instances of CartProvider.
onSetItems No Triggered only when setItems invoked.
onItemAdd No Triggered on items added to your cart, unless the item already exists, then onItemUpdate will be invoked.
onItemUpdate No Triggered on items updated in your cart, unless you are setting the quantity to 0, then onItemRemove will be invoked.
onItemRemove No Triggered on items removed from your cart.
onEmptyCart No Triggered on empty cart.
storage No Must return [getter, setter].
metadata No Custom global state on the cart. Stored inside of metadata.

useCart

The useCart hook exposes all the getter/setters for your cart state.

setItems(items)

The setItems method should be used to set all items in the cart. This will overwrite any existing cart items. A quantity default of 1 will be set for an item implicitly if no quantity is specified.

Args

  • items[] (Required): An array of cart item object. You must provide an id and price value for new items that you add to cart.

Usage

import { useCart } from "react-use-cart";

const { setItems } = useCart();

const products = [
  {
    id: "ckb64v21u000001ksgw2s42ku",
    name: "Fresh Foam 1080v9",
    brand: "New Balance",
    color: "Neon Emerald with Dark Neptune",
    size: "US 10",
    width: "B - Standard",
    sku: "W1080LN9",
    price: 15000,
  },
  {
    id: "cjld2cjxh0000qzrmn831i7rn",
    name: "Fresh Foam 1080v9",
    brand: "New Balance",
    color: "Neon Emerald with Dark Neptune",
    size: "US 9",
    width: "B - Standard",
    sku: "W1080LN9",
    price: 15000,
  },
];

setItems(products);

addItem(item, quantity)

The addItem method should be used to add items to the cart.

Args

  • item (Required): An object that represents your cart item. You must provide an id and price value for new items that you add to cart.
  • quantity (optional, default: 1): The amount of items you want to add.

Usage

import { useCart } from "react-use-cart";

const { addItem } = useCart();

const product = {
  id: "cjld2cjxh0000qzrmn831i7rn",
  name: "Fresh Foam 1080v9",
  brand: "New Balance",
  color: "Neon Emerald with Dark Neptune",
  size: "US 9",
  width: "B - Standard",
  sku: "W1080LN9",
  price: 15000,
};

addItem(product, 2);

updateItem(itemId, data)

The updateItem method should be used to update items in the cart.

Args

  • itemId (Required): The cart item id you want to update.
  • data (Required): The updated cart item object.

Usage

import { useCart } from "react-use-cart";

const { updateItem } = useCart();

updateItem("cjld2cjxh0000qzrmn831i7rn", {
  size: "UK 10",
});

updateItemQuantity(itemId, quantity)

The updateItemQuantity method should be used to update an items quantity value.

Args

  • itemId (Required): The cart item id you want to update.
  • quantity (Required): The updated cart item quantity.

Usage

import { useCart } from "react-use-cart";

const { updateItemQuantity } = useCart();

updateItemQuantity("cjld2cjxh0000qzrmn831i7rn", 1);

removeItem(itemId)

The removeItem method should be used to remove an item from the cart.

Args

  • itemId (Required): The cart item id you want to remove.

Usage

import { useCart } from "react-use-cart";

const { removeItem } = useCart();

removeItem("cjld2cjxh0000qzrmn831i7rn");

emptyCart()

The emptyCart() method should be used to remove all cart items, and resetting cart totals to the default 0 values.

Usage

import { useCart } from "react-use-cart";

const { emptyCart } = useCart();

emptyCart();

clearCartMetadata()

The clearCartMetadata() will reset the metadata to an empty object.

Usage

import { useCart } from "react-use-cart";

const { clearCartMetadata } = useCart();

clearCartMetadata();

setCartMetadata(object)

The setCartMetadata() will replace the metadata object on the cart. You must pass it an object.

Args

  • object: A object with key/value pairs. The key being a string.

Usage

import { useCart } from "react-use-cart";

const { setCartMetadata } = useCart();

setCartMetadata({ notes: "This is the only metadata" });

updateCartMetadata(object)

The updateCartMetadata() will update the metadata object on the cart. You must pass it an object. This will merge the passed object with the existing metadata.

Args

  • object: A object with key/value pairs. The key being a string.

Usage

import { useCart } from "react-use-cart";

const { updateCartMetadata } = useCart();

updateCartMetadata({ notes: "Leave in shed" });

items = []

This will return the current cart items in an array.

Usage

import { useCart } from "react-use-cart";

const { items } = useCart();

isEmpty = false

A quick and easy way to check if the cart is empty. Returned as a boolean.

Usage

import { useCart } from "react-use-cart";

const { isEmpty } = useCart();

getItem(itemId)

Get a specific cart item by id. Returns the item object.

Args

  • itemId (Required): The id of the item you're fetching.

Usage

import { useCart } from "react-use-cart";

const { getItem } = useCart();

const myItem = getItem("cjld2cjxh0000qzrmn831i7rn");

inCart(itemId)

Quickly check if an item is in the cart. Returned as a boolean.

Args

  • itemId (Required): The id of the item you're looking for.

Usage

import { useCart } from "react-use-cart";

const { inCart } = useCart();

inCart("cjld2cjxh0000qzrmn831i7rn") ? "In cart" : "Not in cart";

totalItems = 0

This returns the totaly quantity of items in the cart as an integer.

Usage

import { useCart } from "react-use-cart";

const { totalItems } = useCart();

totalUniqueItems = 0

This returns the total unique items in the cart as an integer.

Usage

import { useCart } from "react-use-cart";

const { totalUniqueItems } = useCart();

cartTotal = 0

This returns the total value of all items in the cart.

Usage

import { useCart } from "react-use-cart";

const { cartTotal } = useCart();

metadata = {}

This returns the metadata set with updateCartMetadata. This is useful for storing additional cart, or checkout values.

Usage

import { useCart } from "react-use-cart";

const { metadata } = useCart();

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Tobias Nielsen

💻

Craig Tweedy

💻

Jonathan Steele

💻

Scott Spence

💡

This project follows the all-contributors specification. Contributions of any kind welcome!

react-use-cart's People

Contributors

allcontributors[bot] avatar craigtweedy avatar filiphsps avatar gettobiasnielsen avatar halafy-ds avatar lxbdr avatar mariosantosdev avatar notrab avatar renovate-bot avatar skidragon avatar spences10 avatar ynnoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-use-cart's Issues

Jest Testing CartProvider Example

I want to write a test which basically checks the total cart item number is currently visible.

So in my _app.js I have something like this

// _app.js
return (
  <CartProvider>
    <Component />
  </CartProvider>
);

On my product page I have function to update the cart

// product.js

const addItem = () => {
  addItem(product);
}

return (
  <>
    <span>{totalItems}</span>
    <button onClick={addItem}>Add</button>
  </>
);

And in my test I would like to test the total items

describe("Add Item", () => {
  beforeEach(() => {
    render(
      <CartProvider>
        <Product product={product} />
      </CartProvider>
    );
  });

  it("Count should increase by one!", () => {
    const count = screen.getByTestId("cart-count");
    expect(count.textContent).toBe("0");
    const button = screen.getByTestId("add-button");
    userEvent.click(button);
    expect(count.textContent).toBe("1");
  });

  it("Count should increase by one for a different user flow!", () => {
    const count = screen.getByTestId("cart-count");
    expect(count.textContent).toBe("0");
    const button = screen.getByTestId("add-button");
    userEvent.click(button);
    expect(count.textContent).toBe("1");
  });
});

However in this case I will get an error as the second test condition for checking 0 count is not correct. It will receive 1 as a total number of items.

Is there a way that I can clean the cart before each test in afterEach()

Using AddItem twice

Hi! Can we use AddItem function twice for wishlist too. How can we define AddItem on different variables. So when we try to add to wishlist the same product is also added to cart. Can we solve this?

Apply discount in cartTotal

Hi! I'm using useCart with NextJs.

Everything works fine, but i want to apply a discount in cartTotal, but don't know how can i override cartTotal with discount to show cartTotal with discount in all app.

Missing type for updateCartMetadata [and others (?)]

Hey, the package's types definitions have some missing types.

Property 'updateCartMetadata' does not exist on type 'CartProviderState'.

CartProviderState:

export declare const CartProvider: React.FC<{
    children?: React.ReactNode;
    id?: string;
    defaultItems?: Item[];
    onSetItems?: (items: Item[]) => void;
    onItemAdd?: (payload: Item) => void;
    onItemUpdate?: (payload: object) => void;
    onItemRemove?: (id: Item["id"]) => void;
    storage?: (key: string, initialValue: string) => [string, (value: Function | string) => void];
    metadata?: Metadata;
}>;

Automatically generate a Cart ID if non provided

Right now CartProvider expects an id prop to function.

If no id is provided, we should automatically generate one, but we should also still accept custom cart IDs if someone wants to manage that themselves.

Better examples

We should add, and improve existing few examples in the examples folder.

It would be useful if the examples weren't just framework specific, but feature based. For example, the locale/currency concept @ynnoj highlighted in #67

Sync the cart's items between tabs

If a customer opens multiple tabs, I want them to be able to seamlessly transition between them and the cart to always show the actual items. At the moment a refresh is required which isn't optimal for the user experience.

Hydration error

Hello,

I'm getting a hydration error in Next JS with React 18 when I use this package. Any idea how to fix this?

An example is when I have an item in my cart, and I show the number of products in the cart, I get an hydration error. Because on the server, the number rendered on the screen is 0, but on the client, the number i 1.

Typescript intellisense

Hiya folks!

Tried to use this in a project and if I try and add a product using addItem and then try to map over the items afterwards, Typescript doesn't seem to understand any of the other props that I passed in with my object. It is only doing intellisense on the Item

interface Item {
  id: string;
  price: number;
  quantity?: number;
  itemTotal?: number;
  [key: string]: any;
}

Seems to fully ignore [key: string]: any;

Is this expected behaviour?

emptyCart() navigate the user to cart page

I'm using the package in my next.js project. When the user clicks the send button to complete their purchase, I added emptyCart() after the order is creation success. But emptyCart() navigates the user to the cart page!

I checked the function, but I found nothing of that behavior in the package.

Can you please check it out, and tell me how to override this?

Thanks

Create better docs

We should probably create some better docs that let us interact with the library.

Adding same items over multiple lines

Some items are being added as a new line instead of adding to the quantity and.
When I update the quantity of one on the cart list, it updates the other.

I have two pages, one main with all items, one with a search (array filter) to show some items.
On the main page, when I add the same item twice, it updates the quantity correctly and the quantity becomes 2.
On the search page, when I add the same item twice, I get two lines for the same item and the quantity of each line stays at 1.
I tried to see if the item was already in the basket with inCart, and it returns false, even though it is there.
I then checked to see if my array for the item was different, but both duplicate lines have the same array, so it's not like I'm adding a slightly different item each time.

There's also another effect of this.
If I add one or two items from the regular page, then add the same item from the search page I can only add the item once from the search page, any other addItem does nothing.

The code for both maps are the same, the only difference is that one is mapped from a filtered array, and the other is not. For the same item on either page, the array for the item itself is identical.

I'm not sure why this is happening.

Support multiple cart item types

Similar to CartQL, it would be helpful to group cart items based on their type.

For example, SKU, TAX, SHIPPING would permit new subTotal, taxTotal, grandTotal, and shippingTotal values.

`itemTotal` calculation is incorrect

The calculated itemTotal value doesn't update to reflect quantity manipulation.

For example, if I add an item with price: 200 increasing or decreasing the quantity of that item does not update the itemTotal value.

Uncaught TypeError: addItem is not a function

Next.js version 11.0.1
React version 17.0.2

Code ([handle].tsx):

import { useCart } from "react-use-cart"

export default function Product() {
  const { addItem } = useCart()
  
  ...
  
  <button onClick={() => addItem({p.id})}>Add to bag</button>
}

When clicking the Add to bag button Next throws the following error:

Unhandled Runtime Error
TypeError: addItem is not a function

Better callback handling

The onX methods don't always fire and is probably down to a poor quick 'n' dirty implementation way back when. It would be good to evaluate what's going on under the hood and how to properly trigger these accordingly.

Add tests

Now more people are using this than just me, we should probably add some test coverage to improve reliability, and maybe seek out a few bugs.

Let's use @testing-library/react-hooks for this 🤩

Environment where localStorage doesnt exist such us mini-apps such us wechat,alipay support

I am using this package with goji.js a airbnb project but unfortnately it uses the localStorage browser api can you use alternatives such us https://www.npmjs.com/package/local-storage to make the package free of localStorage or another way to make the documentation clear on how to write the storage prop value of the provider component since the documentation is not clear enough on how to write the getters and setters to the props.
Regards

Make local storage optional

By default we assume people want to persist their cart with localStorage.

While this is probably ok for most, we should probably the ability for anyone to overwrite the getter/setter methods on that.

Simply by passing a storage prop would work on the CartProvider constructor.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Missing package.json file.

A package.json file at the root of your project is required to release on npm.

Please follow the npm guideline to create a valid package.json file.


Good luck with your project ✨

Your semantic-release bot 📦🚀

[Security] Workflow release.yml is using vulnerable action actions/checkout

The workflow release.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

Setters methods not found

Hi, thanks for the great work.

I'm trying to use methods like addItem, removeItem...and I keep getting addItem is not a function.
I followed all the examples and properties like isEmpty or cartTotal are working just fine, but when trying to use a method I get an error.
I'm using NextJS. Here a simple example:

`import { CartProvider, useCart } from "react-use-cart";

const ProductDetails = () => {

const { addItem } = useCart();

const product = {
    id: 1,
    name: "Sports Hooded Sweatshirt",
    price: 18.99
}

useEffect(() => {
    addItem(product);
}, []);

`

The error:

image

I've added the addItem inside useEffect for testing purposes.

My page is wrapped by CartProvider also, but I think this is just to keep track of the states.

I don't know if is a bug or what is, so I decide to report this as an issue. Sorry if it's not the case.

Support global cart metadata

Similar to what happens with CartQL, it would be good to support a updateCart function that allows you to set global metadata on the cart.

This can be helpful for tracking any order notes, coupon codes, etc.

Example:

const { updateCart } = useCart()

updateCart({
  coupon: 'FREESHIPPING'
})

The only thing that would need decided is how to access this. I'd prefer to namespace this under metadata, so you'd be able to do:

function () {
  const { metadata } = useCart()

  return (
    <p>{metadata.coupon}</p>
  )
}

'totalCart' is always 0 when use multiple carts

I'm trying to add multiple carts to my website, one per "pack", the problem is that i can't use cartTotal.

/pages/pack/[id].js

import { CartProvider,} from "react-use-cart";
import CartComponent from "../../components/CartComponent";

export default function PackPage({ data }) {
return (
   <CartProvider id={data.seller.id}>
      ... Render the page component
      <CartComponent />
   </CartProvider>
  )
}

/components/CartComponent/

import { useCart } from "react-use-cart";

export default function CartComponent() {
  const { cartTotal } = useCart();
  return (
    <div>
      <h4>{cartTotal}</h4> // This is always 0
    </div>
  );
}

Uncaught TypeError: addItem is not a function IONIC REACT

I get this error when i click button add to cart : Uncaught TypeError: addItem is not a function
I import collection

import React, { useState } from 'react';
import { useCart } from "react-use-cart";
 const { addItem } = useCart();

And call function like this:

<IonNote slot="end"><IonButton onClick={() => addItem(item, 1)}>Добави</IonButton></IonNote>

Add Next.js example

We should add a basic Next.js example to the examples folder showing how to add the CartProvider and one or two basic function calls.

item id as <string | number>

In most cases there are entities with id as number, and not so convenient to cast to string and back. Is it possible to make id at item string or number?

Improved CI process

Appears that yarn test is only ran as part of the release workflow against the default branches (main, beta).

We should introduce CI for all PRs to ensure:

  • The package builds.
  • Tests pass.

We can use on.pull_request with a separate workflow file to build and test the package.

TypeError: addItem is not a function

AddItem is working at first, but when I refresh the page this AddItem is not a function error is displayed. I've tried console.log() the value of useCart and all the function is gone when I refresh it.

Next.js cart storage

Hi!

I'm using the library with Next.js.

When trying to using the library in pages which rendered server-side, the content of the server doesn't match the client. It seems this could be related to the cart being stored using localStorage and this is not available on the server, only in the client.

One thought it to use the storage prop, have you ran into this issue before ?

I tried using the storage prop and the following snipped fails with the following error. Could you provide an example of how the prop should be used and its initial value

function MyApp({ Component, pageProps }) {
  const [cart, setCart] = useState();
  return (
    <div>
      <CartProvider storage={() => [cart, setCart]}>
        <Layout>
          <Component {...pageProps} />;
        </Layout>
      </CartProvider>
    </div>
  );
}

image

Missing onEmptyCart prop

Good morning everyone! It would be useful to have onEmptyCart available, triggered on empty cart.

Add Gatsby example

We should add a Gatsby example that shows how to wrap Gatsby with CartProvider and make a few function calls.

Add development demo

Instead of using yarn link to work on any new features, we should explore adding a local development demo.

Something as simple as examples/create-react-app that imports from the root would be a good first step.

Add currency formatting

Right now this library only handles raw prices, but it would be useful to format the raw price for a global cart currency and provide this meta data along with each item, and the overall cart totals.

Expire after x hours without updates?

Does the cart ever expire as is?

I don't want my customers coming back in a year with a cart full of products that no longer exist.
48 hours or so would be ideal

Husky Pre-commits is not working, also need to run test script and linting auto-fix before commit.

This issue should resolve:

  • husky runs the test, linting, and linting auto-fix scripts
  • add a test watch command for our test runner

Not sure if there is a better way but here is what I got so far.

I propose the following updates:

  • According to the husky docs, a .husky folder must be created then the pre-commit hook file can be added:

  • https://github.com/typicode/husky

  • Then these scripts can run as a pre-commit:

  • npm run test

  • npm run lint:fix

  • npm run lint

These scripts will make sure the test code passes then fix any linting errors then give the user an error so they can commit the linting code fixes that are auto-generated.

Proposed package.json updates:

  • "test:watch": "npm run test -- --watch", //Makes it easier to update code while running the test runner
  • "lint:fix": "npm run lint -- --fix", //This will fix our linting errors
  • "prepare:husky": "husky install", //Create the husky.sh file
//Remove
 "husky": {
    "hooks": {
      "pre-commit": "tsdx lint"
    }
  },

Just have to figure out how to run prepare:husky when npm install. I guess the husky.sh file shouldn't be commited since a .gitignore has been generated to not include it but I will look into it more.

image

Support multiple carts

Currently since the localStorage key is react-use-cart by default, and no way of changing it, it's not possible to support multiple carts right now.

Add Create React App example

Using Create React App, we should add a basic demo showing how to wrap the global CartProvider and make similar function calls to those in #33 #34

Handle multiple prices per item

I have a use case where I am implementing a localised cart where cart items may have a different prices per currency/locale.

Currently items are require to have a single price: number, which limits the possibility of offering multiple prices on cart items.

Support price modifiers

One of the ways this library has been extended in one project is by allowing price modifiers.

It would make sense to introduce new functions for addPriceModifier, updatePriceModifier and deleteModifier. Along with new functions to generate cart prices with and without modifiers.

Each modifier can essentially be another item that has id/name/description/quantity etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.