Gathering detailed insights and metrics for js-message
Gathering detailed insights and metrics for js-message
Gathering detailed insights and metrics for js-message
Gathering detailed insights and metrics for js-message
js-crypto-hmac
Universal Module for HMAC (Hash-based Message Authentication Code) in JavaScript
@tidy-ui/message
Message component can be used to display important information on a page based on the information importance level, powered by various styles (with theming) and settings
iframe-message-js
#### iframe 父子窗口通信工具
@cumulus/cumulus-message-adapter-js
Cumulus message adapter
npm install js-message
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.9
Supply Chain
99.4
Quality
78.2
Maintenance
100
Vulnerability
100
License
JavaScript (83.13%)
HTML (16.87%)
Total Downloads
255,190,982
Last Day
93,424
Last Week
795,183
Last Month
4,188,376
Last Year
50,205,675
10 Stars
20 Commits
3 Forks
4 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
2.1.0
Package Id
js-message@2.1.0
Unpacked Size
9.42 kB
Size
3.33 kB
File Count
5
NPM Version
10.2.5
Node Version
20.10.0
Publised On
11 Jan 2024
Cumulative downloads
Total Downloads
Last day
-51%
93,424
Compared to previous day
Last week
-19.5%
795,183
Compared to previous week
Last month
2.2%
4,188,376
Compared to previous month
Last year
-6.2%
50,205,675
Compared to previous year
2
Normalized JS & JSON Message and event Protocol for node.js, vanilla.js (plain old javascript), react.js, websockets, rest api's, node-ipc, and any other protocol that might use a js object and or a JSON string.
js-message allows for seamless conversion of JSON messages and events to JS objects for a normalized implementation on the server and in the client without needing to concern yourself with JSON intermediaries and custom parsers.
Things are just easier when you normalize them.
npm js-message info : See npm trends and stats for js-message
npm install --save js-message
method or key | type | mutable | description |
---|---|---|---|
type | String | true | the type of message |
data | Object | true | the message data or payload |
load | func | false | load a message from JSON, this will return a message with the type of error if not valid JSON |
JSON | String | not by user | JSON representation of the message |
For the browser you can do either an import with the path to make the first http request for your module, and have it cached for other scripts thereafter OR you can import it with the <script>
tag upfront which automatically loads as defer
so it doesn't interrupt the parser.
1<script type="module" src='/path/to/module/js-message-vanilla.js' /> 2
Both node and the browser now support import
statements. If you use relative pathing you can use the same exact code from node in the browser without even transpiling much the less bundling.
1 2 //works for browser natively AND node natively 3 import { default as Message } from './node_modules/js-message/Message.js'; 4 //works for browser transpiled AND node natively 5 import { default as Message } from 'js-message'; 6 7 var myMessage=new Message; 8 myMessage.type='message or event type'; 9 myMessage.data.something='something'; 10 myMessage.data.stuff=[1,2,3,4,5] 11 12 console.log(myMessage.JSON); 13
1 2 //works for browser natively AND node natively 3 import { default as Message } from './node_modules/js-message/Message.js'; 4 //works for browser transpiled AND node natively 5 import { default as Message } from 'js-message'; 6 7 //lets say we have the above example running on 8 //a websocket server sending js-messages as JSON 9 // 10 //and lets say this is the client in the browser 11 ws.on( 12 'message', 13 handleMessage 14 ); 15 16 handleMessage(e){ 17 var message=new Message; 18 message.load(e.data); 19 20 console.log(message.type, message.data); 21 } 22
1 2 //works for browser natively AND node natively 3 import { default as Message } from './node_modules/js-message/Message.js'; 4 //works for browser transpiled AND node natively 5 import { default as Message } from 'js-message'; 6 7 //client example, but works the same on server too! 8 var ws=new WebSocket('ws://myawesomeWS:8000'); 9 10 var myMessage=new Message; 11 myMessage.type='setUsername'; 12 myMessage.data.username='sideshow bob'; 13 14 ws.send(myMessage.JSON); 15
This work is licenced via the MIT Licence
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 1/19 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More