Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

golgoth

1.4.0 • Public • Published

Ω Golgoth

Meta-package including all the libs I always need (lodash, pify, etc)

When building project in JavaScript, I often end up installing the same dependencies over and over again. This meta-package is a prototyping shortcut for me, to install them all in one go.

Libraries included

Name Description
chalk Pretty colors in terminal output. Default colors updated to match my colorscheme.
dayjs Easy date parsing and comparing
dedent Easy multiline strings
got HTTP requests made easy
lodash JavaScript utility belt
pAll, pMap, pProps and pMapSeries Iterate over async methods
pify Convert those pesky callbacks into Promises
query-string Parse query strings
time-span Simplified timers

Usage

Use the flavor your prefer:

// Load everything and then use what you need
const golgoth = require('golgoth');
golgoth.pify();
 
// import only what you need
const pAll = require('golgoth/lib/pAll');
const _ = require('golgoth/lib/lodash');

Additions

_.flatten() and _.unflatten() for objects

Takes any nested object and flatten its keys, or revert it

const data = {
  foo: {
    bar: ['baz', 'quxx'],
  },
};
const flatData = _.flatten(data);
console.info(flatData);
// {
//   'foo.bar.0': 'baz',
//   'foo.bar.1': 'quxx'
// }
console.info(_.unflatten(flatData));
// {
//  foo: {
//    bar: ['baz', 'quxx']
//  }
// }

Default modules for dayjs

dayjs is loaded with the following plugins:

  • utc
  • isSameOfBefore
  • isSameOrAfter

Notes

lodash is available either as lodash or _.

Keywords

none

Install

npm i golgoth

DownloadsWeekly Downloads

397

Version

1.4.0

License

MIT

Unpacked Size

21.4 kB

Total Files

52

Last publish

Collaborators

  • avatar