GithubHelp home page GithubHelp logo

pnxdxt / help-curry Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

Small js package I use to quickly curry functions

Home Page: https://www.npmjs.com/package/help-curry

License: MIT License

JavaScript 70.92% TypeScript 29.08%
javascript npm-package utils

help-curry's Introduction

help-curry

Small js package I use to quickly curry functions

XO code style GitHub workflow status npm bundle size npm downloads

Install

$ npm install help-curry

Import

This package is pure ESM. It cannot be require()'d from CommonJS.

Use import foo from 'foo' instead of const foo = require('foo') to import the package.

// Load entire build
import curry from 'help-curry';

If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).

You also need to make sure you're on the latest minor version of Node.js. At minimum Node.js 12.20, 14.14, or 16.0.

Read more here: sindresorhus/esm-package

Usage

function sum(a, b, c) {
  return a + b + c;
}

let curriedSum = curry(sum);

curriedSum(1, 2, 3);
//=> 6, still callable normally

curriedSum(1)(2,3)
//=> 6, currying of 1st arg

curriedSum(1)(2)(3)
//=> 6, full currying

License

MIT © Paul Nodet

help-curry's People

Contributors

pnodet avatar

Watchers

 avatar

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.