https://github.com/supercharge/goodies
Helper and utility functions for Node.js
https://github.com/supercharge/goodies
hacktoberfest helper-functions nodejs supercharge
Last synced: 2 months ago
JSON representation
Helper and utility functions for Node.js
- Host: GitHub
- URL: https://github.com/supercharge/goodies
- Owner: supercharge
- License: mit
- Created: 2020-01-16T09:46:06.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T06:56:23.000Z (over 1 year ago)
- Last Synced: 2025-04-17T01:26:18.046Z (2 months ago)
- Topics: hacktoberfest, helper-functions, nodejs, supercharge
- Language: TypeScript
- Homepage: https://superchargejs.com/docs/goodies
- Size: 124 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Goodies
Helper and utility functions for Node.js.
Installation ·
Docs ·
API
Follow @marcuspoehls and @superchargejs for updates!
---
## Introduction
The `@supercharge/goodies` package provides a handful of useful helper functions for Node.js and JavaScript, like an async `tap` function.## Installation
```
npm i @supercharge/goodies
```## Docs
Find all the [details for `@supercharge/goodies` in the extensive Supercharge docs](https://superchargejs.com/docs/goodies).## API
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
})// [email protected]
```## Contributing
Do you miss a goodie function? We very much appreciate your contribution! Please send in a pull request 😊1. Create a fork
2. Create your feature branch: `git checkout -b my-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request 🚀## License
MIT © [Supercharge](https://superchargejs.com)---
> [superchargejs.com](https://superchargejs.com) ·
> GitHub [@supercharge](https://github.com/supercharge) ·
> Twitter [@superchargejs](https://twitter.com/superchargejs)