GithubHelp home page GithubHelp logo

mrosata / ecma-utils Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 726 KB

An npm/yarn package with JavaScript utils that are useful across projects. Includes validation util namespace and caching

License: MIT License

JavaScript 100.00%

ecma-utils's Introduction

ECMA-UTILS

Ecma utils is a library created for use in many different projects. As such it doesn't strictly adhere to one paradigm or coding style over another. That being said, most of the functions I've been writing lately are to help with writing functional programming.

INSTALL
  npm i ecma-utils
  # or...
  yarn add ecma-utils
IS

The is class is a collection of static methods used for type validation. It is very simple to read and understand.

if (is.array(someThing)) {
  console.log('jump for joy')
}
if (is.not(is.object(someItems)) {
  console.log('Hey! That's a no object!')
}
UTILS

The utils module is a bunch of lambda abstraction type functions. The typical kit is in there, compose, map, reduce, pluck, an assortment of array and string functions. This module is under the most development/testing at the moment. As such it is incomplete and subject to great change in both how it works and how it is used.

CACHE-ME

The cache-me module is built to wrap object methods with a private cache. At the moment it only works for objects and methods, pass a list of strings as methods to wrap (to customize caching) or don't and the module will wrap each method on the object with a cache.

    const abacus = {
      add() {/*...*/},
      mult() {/*...*/},
      rand() {/*...*/}
    }
    
    // Cache only the add and mult methods on abacus
    cacheMe(myObject, 'add', 'mult')
Here is a list of all functions needing testing in utils

isCallable isObject isDefined isBool isNone not isNeg noop bool int sum list keys set get at zip unzipWith apply lastItem lastIndex head pluck pluckN immutableSplice count push map filter reduce padList tap lTap minOf maxOf inRange divideBy divide match replaceAll str strMatchRE strMatchStr strToRegExp ifOrElse orElse initializeToType compose runWith

ย 


Comments, Suggestions, Talky-talks?

Troubles, Issues, Uh-ohs and Boom-booms?

Thanks and Appreciation

ecma-utils's People

Contributors

mrosata avatar

Stargazers

 avatar Sukmanov Bogdan avatar

Watchers

James Cloos avatar  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.