Socket
Socket
Sign inDemoInstall

wspromisify

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wspromisify - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

.npmignore

48

package.json
{
"_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.4"
"version": "0.0.5",
"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 es
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.
Default constructor config is
```{
```javascript
{
// You can also use plain text and blobs in future.

@@ -24,2 +39,4 @@ data_type: 'json',

reconnect: 2,
// Lazy connect: connects only if something sent (then sends all of them!)
lazy: false,
// You can set your own middleware here.

@@ -34,7 +51,11 @@ adapter: ((host, protocols) => new WebSocket(host, protocols)),

}
}```
}
```
Methods: ```
Methods:
```javascript
// sends any type of message.
send(message),
on(event_name, handler, predicate),
close()

@@ -44,3 +65,4 @@

Example: ```
Example:
```javascript

@@ -47,0 +69,0 @@ import * as WSP from 'wspromisify' // Temporary. Will be regular esm.

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