New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

internal

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

internal - npm Package Compare versions

Comparing version 1.0.8 to 2.0.0

dist/assert/index.d.ts

53

package.json
{
"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
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc