Utility functions for Node.js and JavaScript

Downloads in past


701.11.17 months ago3 years agoMinified + gzip package size for @supercharge/goodies in KB


<img width="471" style="max-width:100%;" src="https://superchargejs.com/images/supercharge-text.svg" />


Helper and utility functions for Node.js.

<a href="#installation"><strong>Installation</strong></a> 路
<a href="#docs"><strong>Docs</strong></a> 路
<a href="#api"><strong>API</strong></a>

<a href="https://www.npmjs.com/package/@supercharge/goodies"><img src="https://img.shields.io/npm/v/@supercharge/goodies.svg" alt="Latest Version"></a>
<a href="https://www.npmjs.com/package/@supercharge/goodies"><img src="https://img.shields.io/npm/dm/@supercharge/goodies.svg" alt="Monthly downloads"></a>

<em>Follow <a href="http://twitter.com/marcuspoehls">@marcuspoehls</a> and <a href="http://twitter.com/superchargejs">@superchargejs</a> for updates!</em>



The @supercharge/goodies package provides a handful of useful helper functions for Node.js and JavaScript, like an async tap function.


``` npm i @supercharge/goodies ```


Find all the details for @supercharge/goodies in the extensive Supercharge docs.


Using @supercharge/goodies is pretty straightforward. The package exports a handful of methods that you can reach for when requiring the package:

tap(value, callback)

Returns the value after running the callback. The callback receives the value as an argument. ```js const { tap } = require('@supercharge/goodies') return tap(await User.find(1), async (user) => { await user.subscribeToNewsletter() }) // returns the user with ID 1 ```

upon(value, callback)

Returns the result of the callback. The callback receives the value as an argument. ```js const { upon } = require('@supercharge/goodies') return upon(await User.find(1), async (user) => { return user.email }) // user@email.com ```


Do you miss a goodie function? We very much appreciate your contribution! Please send in a pull request 馃槉
  1. Create a fork
  1. Create your feature branch: git checkout -b my-feature
  1. Commit your changes: git commit -am 'Add some feature'
  1. Push to the branch: git push origin my-new-feature
  1. Submit a pull request 馃殌


MIT 漏 Supercharge ---
superchargejs.com 聽路聽
GitHub @supercharge 聽路聽
Twitter @superchargejs