Comparing version 1.0.8 to 2.0.0
{ | ||
"name": "internal", | ||
"version": "1.0.8", | ||
"description": "internal queue for your public libraries and APIs", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "test" | ||
"version": "2.0.0", | ||
"files": [ | ||
"dist/**/index.js", | ||
"dist/**/index.d.ts" | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "11.0.1", | ||
"@rollup/plugin-node-resolve": "6.1.0", | ||
"@rollup/plugin-sucrase": "3.0.0", | ||
"@types/assert": "1.4.3", | ||
"@types/mocha": "5.2.7", | ||
"globby": "10.0.1", | ||
"mocha": "7.0.0", | ||
"rollup": "1.27.14", | ||
"serve": "11.3.0", | ||
"typescript": "3.7.4" | ||
}, | ||
"dependencies": { | ||
"debug": "^2.2.0", | ||
"object-assign": "^4.0.1", | ||
"sliced": "^0.0.5", | ||
"wrapped": "^1.0.1" | ||
"preact": "10.1.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.4.5" | ||
}, | ||
"scripts": { | ||
"test": "make test" | ||
}, | ||
"keywords": [ | ||
"internal", | ||
"promises", | ||
"queue", | ||
"async", | ||
"sync", | ||
"generators" | ||
], | ||
"author": "Matthew Mueller", | ||
"license": "MIT" | ||
} | ||
"prettier": { | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 240, | ||
"jsxBracketSameLine": true | ||
} | ||
} |
@@ -1,69 +0,44 @@ | ||
# internal | ||
# Internal | ||
Internal queue for your public libraries and APIs. This library makes it easy to build asynchronous fluent APIs. You can also think of it as embedded promises. | ||
Internal is a curated set of high-quality node modules. Internal aims to be the standard library node.js never had. | ||
Some examples of APIs you can build using **internal**: | ||
Each module in this repository has the following requirements | ||
- [nightmare](https://github.com/segmentio/nightmare) | ||
- [yieldb](https://github.com/pebble/yieldb) | ||
- Well-tested | ||
- Small footprint | ||
- Minimal API surface | ||
- Works on both client and server (stubs are ok) | ||
- Good documentation | ||
- Provides type definitions | ||
## Features | ||
At it's best, this repository simply pulls in other modules. Occassionally there may be some freshly brewed code. | ||
- Runs asynchronous functions in order | ||
- Supports namespacing at any depth | ||
- Returns a promise for additional chaining | ||
- API methods can be synchronous, asynchronous, generators or promises | ||
- All methods are yieldable inside [co](https://github.com/tj/co) | ||
## Usage | ||
```sh | ||
yarn add internal | ||
``` | ||
## Usage | ||
**building a simple redis client:** | ||
``` | ||
import proxy from 'internal/proxy' | ||
``` | ||
```js | ||
var Internal = require('internal') | ||
var client = require('redis') | ||
## What happened to the original `internal`? | ||
// Wrap methods in Internal | ||
var internal = Internal({ | ||
connect: function (url) { | ||
this.client = client.createClient(url) | ||
}, | ||
get: function (key, fn) { | ||
this.client.get(key, fn) | ||
}, | ||
set: function (key, value, fn) { | ||
this.client.set(key, value, fn) | ||
The code for the original `internal` lives under the `1.x` versions. You can fix this by adjusting your dependencies in the following way: | ||
```json | ||
{ | ||
"dependencies": { | ||
"internal": "1.x" | ||
} | ||
}) | ||
function Redis () { | ||
// initialization stuff | ||
} | ||
Redis.prototype.connect = function (url) { | ||
// initialize an instance of internal, queue the | ||
// connect, and return the internal object | ||
return internal().connect(url) | ||
} | ||
var redis = new Redis() | ||
// all async calls are queued | ||
redis | ||
.connect('redis://localhost') | ||
.set('key', 'value') | ||
.get('key') | ||
.then(value => console.log(value)) | ||
``` | ||
See test for additional usage examples | ||
I'm sorry in advance if I've caused any inconvenience with this transition. | ||
## Installation | ||
``` | ||
npm install internal | ||
``` | ||
## License | ||
MIT, go wild. | ||
MIT |
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
25894
1
14
698
10
2
45
1
+ Addedpreact@10.1.1
+ Addedpreact@10.1.1(transitive)
- Removeddebug@^2.2.0
- Removedobject-assign@^4.0.1
- Removedsliced@^0.0.5
- Removedwrapped@^1.0.1
- Removedco@3.1.0(transitive)
- Removeddebug@2.6.9(transitive)
- Removedms@2.0.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedsliced@0.0.51.0.1(transitive)
- Removedwrapped@1.0.1(transitive)