Helper and utility functions for Node.js.
Installation · Docs · API
Follow @marcuspoehls and @superchargejs for updates!
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:
Returns the value
after running the callback
. The callback receives the value as an argument.
const { tap } = require('@supercharge/goodies')
return tap(await User.find(1), async (user) => {
await user.subscribeToNewsletter()
})
// returns the user with ID 1
Returns the result of the callback. The callback receives the value as an argument.
const { upon } = require('@supercharge/goodies')
return upon(await User.find(1), async (user) => {
return user.email
})
// [email protected]
Do you miss a goodie function? We very much appreciate your contribution! Please send in a pull request 😊
- Create a fork
- Create your feature branch:
git checkout -b my-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request 🚀
MIT © Supercharge
superchargejs.com · GitHub @supercharge · Twitter @superchargejs