wspromisify
Advanced tools
Comparing version 0.0.401 to 0.0.501
{ | ||
"_from": "wspromisify@0.0.201", | ||
"_id": "wspromisify@0.0.201", | ||
"_args": [ | ||
[ | ||
"wspromisify@0.0.5", | ||
"C:\\Users\\m.akiliev\\go\\workspace\\klb\\view" | ||
] | ||
], | ||
"_from": "wspromisify@0.0.5", | ||
"_id": "wspromisify@0.0.5", | ||
"_inBundle": false, | ||
@@ -11,8 +17,8 @@ "_integrity": "sha512-wWSjaaNK9B3wOYyw5DWhPq+AGRFx+4qBs0bbazPkNPwWwXnNLBcthnEBSZdyhqx8SGulRzV8DzH8IcUd9DbYsw==", | ||
"registry": true, | ||
"raw": "wspromisify@0.0.4", | ||
"raw": "wspromisify@0.0.5", | ||
"name": "wspromisify", | ||
"escapedName": "wspromisify", | ||
"rawSpec": "0.0.4", | ||
"rawSpec": "0.0.5", | ||
"saveSpec": null, | ||
"fetchSpec": "0.0.201" | ||
"fetchSpec": "0.0.5" | ||
}, | ||
@@ -22,6 +28,6 @@ "_requiredBy": [ | ||
], | ||
"_resolved": "https://registry.npmjs.org/wspromisify/-/wspromisify-0.0.201.tgz", | ||
"_shasum": "e4a64f1815e2f59ec5081629187d2342d4b34c20", | ||
"_spec": "wspromisify@0.0.201", | ||
"_where": "C:\\Users\\m.akiliev\\Music\\WebsocketPromisify", | ||
"_resolved": "https://registry.npmjs.org/wspromisify/-/wspromisify-0.0.5.tgz", | ||
"_shasum": "6cf45bd945835d95ed2b0dcf6428a31d26002c74", | ||
"_spec": "0.0.5", | ||
"_where": "C:\\Users\\m.akiliev\\go\\workspace\\klb\\view", | ||
"author": { | ||
@@ -33,3 +39,3 @@ "name": "Michael Akiliev" | ||
}, | ||
"bundleDependencies": [], | ||
"bundleDependencies": false, | ||
"deprecated": false, | ||
@@ -50,4 +56,4 @@ "description": "Makes it easier to handle different data via WebSockets.", | ||
"license": "ISC", | ||
"main": "WS.js", | ||
"module": "WS.esm.js", | ||
"main": "dist/ws.js", | ||
"module": "dist/ws.esm.js", | ||
"name": "wspromisify", | ||
@@ -59,5 +65,19 @@ "repository": { | ||
"scripts": { | ||
"test": "npm run test" | ||
"test": "npm run test", | ||
"dev": "rollup --watch -c --config src/rollup.config.js --environment INCLUDE_DEPS,BUILD:development", | ||
"prod:cjs": "rollup -c --config src/rollup.config.js --environment INCLUDE_DEPS,BUILD:cjs", | ||
"prod:es": "rollup -c --config src/rollup.config.js --environment INCLUDE_DEPS,BUILD:es", | ||
"prod": "npm run prod:es && npm run prod:cjs" | ||
}, | ||
"version": "0.0.401" | ||
"version": "0.0.501", | ||
"devDependencies": { | ||
"@types/node": "^8.0.58", | ||
"rollup": "^0.52.1", | ||
"rollup-plugin-commonjs": "^8.2.6", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"rollup-plugin-typescript2": "^0.8.4", | ||
"typescript": "^2.6.2" | ||
}, | ||
"types": "./index.d.ts" | ||
} |
# WebsocketPromisify | ||
Makes websocket's API just like REST with Promise-like API, with native Promises. | ||
// If you detected some bug or so, please, fill an issue. | ||
Makes a Promise-like WebSocket connection. | ||
If something sent before connection is connection is estabilished, it sends when its ready. | ||
Features (almost all are tunable via constructor config below.) | ||
- Async/await ready. | ||
- ES-module and commonjs built-in. | ||
- Types (d.ts) included. | ||
- Automatically reconnects. | ||
- Any id and data keys to negotiate with your back-end. | ||
- Lazy connect: connects only if something sent, then send all of them! | ||
- Supports middleware. E.g. you can use 'ws' package in Node! | ||
- Custom easy .on method with or without condition: analog to .addEventListener. | ||
- Can log messages/frames/response time into console or wherever you want to. (Hello, firefox 57+!) | ||
- Any protocols field. | ||
- Rejects if sent into closed socket or after some timeout without response. | ||
- If something sent before connection is connection is estabilished, it sends when its ready. | ||
@@ -25,2 +39,4 @@ | ||
reconnect: 2, | ||
// Lazy connect: connects only if something sent (then sends all of them!) | ||
lazy: false, | ||
// You can set your own middleware here. | ||
@@ -41,3 +57,5 @@ adapter: ((host, protocols) => new WebSocket(host, protocols)), | ||
// sends any type of message. | ||
send(message), | ||
on(event_name, handler, predicate), | ||
close() | ||
@@ -50,3 +68,3 @@ | ||
import * as WSP from 'wspromisify' // Temporary. Will be regular esm. | ||
import WSP from 'wspromisify' | ||
@@ -53,0 +71,0 @@ |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
38821
11
858
95
7
3
1