Socket
Socket
Sign inDemoInstall

@supercharge/goodies

Package Overview
Dependencies
0
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @supercharge/goodies

Async utility functions for Node.js and JavaScript


Version published
Weekly downloads
9.7K
increased by6.7%
Maintainers
3
Install size
22.1 kB
Created
Weekly downloads
 

Changelog

Source

1.8.0 - 2021-01-05

Added

  • esmRequire(input) method requires and returns the resolved export of input from ESM and CommonJS

Updated

  • bump dependencies

Readme

Source


Goodies

Helper and utility functions for Node.js.


Installation · Docs · API



Latest Version Monthly downloads

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.

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.

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.

const { upon } = require('@supercharge/goodies')

return upon(await User.find(1), async (user) => {
  return user.email
})

// user@email.com

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


superchargejs.com  ·  GitHub @supercharge  ·  Twitter @superchargejs

Keywords

FAQs

Last updated on 05 Jan 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc