@supercharge/goodies
Advanced tools
Comparing version 1.0.0 to 1.1.0
# Changelog | ||
## [1.1.0](https://github.com/supercharge/goodies/compare/v1.0.0...v1.1.0) - 2020-04-15 | ||
### Added | ||
- `upon(value, callback)` method: `upon` calls the given `callback` function with the `value` and returns the result of the callback | ||
- `tap` the value when a promise as the first argument before passing it to the callback | ||
### Updated | ||
- move code base to TypeScript to ship this package with typings | ||
- add API section in Readme outlining available methods | ||
## 1.0.0 - 2020-01-16 | ||
@@ -5,0 +16,0 @@ |
{ | ||
"name": "@supercharge/goodies", | ||
"description": "(Async) helper functions that you will love.", | ||
"version": "1.0.0", | ||
"description": "Async utility functions for Node.js and JavaScript", | ||
"version": "1.1.0", | ||
"author": "Marcus Pöhls <marcus@superchargejs.com>", | ||
@@ -13,8 +13,11 @@ "bugs": { | ||
"@hapi/lab": "~21.0.0", | ||
"@typescript-eslint/eslint-plugin": "~2.28.0", | ||
"eslint": "~6.8.0", | ||
"eslint-config-standard": "~14.1.0", | ||
"eslint-plugin-import": "~2.20.0", | ||
"eslint-plugin-node": "~11.0.0", | ||
"eslint-config-standard-with-typescript": "~15.0.1", | ||
"eslint-plugin-import": "~2.20.2", | ||
"eslint-plugin-node": "~11.1.0", | ||
"eslint-plugin-promise": "~4.2.1", | ||
"eslint-plugin-standard": "~4.0.1" | ||
"eslint-plugin-standard": "~4.0.1", | ||
"lab-transform-typescript": "~3.0.1", | ||
"typescript": "~3.8.3" | ||
}, | ||
@@ -25,15 +28,17 @@ "engines": { | ||
"files": [ | ||
"src" | ||
"dist", | ||
"index.js" | ||
], | ||
"homepage": "https://github.com/supercharge/goodies", | ||
"keywords": [ | ||
"nodejs", | ||
"utilities", | ||
"goodies", | ||
"helper", | ||
"function", | ||
"supercharge", | ||
"superchargejs", | ||
"function", | ||
"helpers", | ||
"goodies", | ||
"nodejs" | ||
"superchargejs" | ||
], | ||
"license": "MIT", | ||
"main": "./src/goodies.js", | ||
"main": "dist", | ||
"publishConfig": { | ||
@@ -47,8 +52,11 @@ "access": "public" | ||
"scripts": { | ||
"lint": "eslint .", | ||
"build": "tsc", | ||
"lint": "eslint src --ext .js,.ts", | ||
"lint:fix": "eslint . --fix", | ||
"list:tests": "lab --assert @hapi/code --dry --verbose", | ||
"test": "lab --assert @hapi/code --leaks --coverage --lint --reporter console --output stdout --reporter html --output ./coverage/coverage.html", | ||
"test:single": "lab --assert @hapi/code --leaks --lint --id" | ||
} | ||
"test": "npm run build && npm run lint && npm run test:run", | ||
"test:run": "lab --transform node_modules/lab-transform-typescript --assert @hapi/code --leaks --coverage --reporter console --output stdout --reporter html --output ./coverage/coverage.html", | ||
"test:single": "lab --transform node_modules/lab-transform-typescript --assert @hapi/code --leaks --lint --id" | ||
}, | ||
"types": "dist" | ||
} |
@@ -16,4 +16,4 @@ <div align="center"> | ||
<a href="#installation"><strong>Installation</strong></a> · | ||
<a href="#Docs"><strong>Docs</strong></a> · | ||
<a href="#usage"><strong>Usage</strong></a> | ||
<a href="#docs"><strong>Docs</strong></a> · | ||
<a href="#api"><strong>API</strong></a> | ||
</p> | ||
@@ -47,5 +47,9 @@ <br/> | ||
## Usage | ||
## 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 | ||
@@ -62,2 +66,16 @@ const { tap } = require('@supercharge/goodies') | ||
#### 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 | ||
``` | ||
## Contributing | ||
@@ -64,0 +82,0 @@ Do you miss a goodie function? We very much appreciate your contribution! Please send in a pull request 😊 |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11485
9
206
96
11
1