Narcissistic Piano Mover
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    zeelibpublic

    zeelib

    A small lib of FP, Node, and DOM utils.

    npm version CircleCI codecov


    Usage

    zeelib is a collection of over 250 utility functions. See the docs for details.

    Example usage:

    import z from 'zeelib'
    // require also works:
    const z = require('zeelib')
     
    // named imports work:
    import { exit, getArgs } from 'zeelib'
    // or with require:
    const { exit, getArgs } = require('zeelib')
     
    // but i highly recommend importing individual functions:
    import getArgs from 'zeelib/lib/get-args'
    import exit from 'zeelib/lib/exit'
    // or with require:
    const getArgs = require('zeelib/lib/get-args')
    const exit = require('zeelib/lib/exit')
     
    if (!module.parent) {
      const args = getArgs()
      if (!args.length) {
        console.log('Usage: my-thing some-command')
        exit(1)
      }
    }

    If you're not importing just the functions you need (and you should be!), you may have problems with front-end builds. Try something like this (assuming a Webpack config):

    node: {
      fs: 'empty',
      net: 'empty',
      tls: 'empty',
      readline: 'empty',
      child_process: 'empty'
    }

    install

    npm i zeelib

    Downloadsweekly downloads

    421

    version

    7.0.2

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar