sendmessage
Advanced tools
Comparing version 2.0.0 to 3.0.0
{ | ||
"name": "sendmessage", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"engines": { | ||
"node": ">= 18.19.0" | ||
}, | ||
"description": "Send a cross process message if message channel is connected.", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"test": "mocha --exit -t 5000 test/*.test.js", | ||
"ci": "c8 npm test", | ||
"lint": "eslint ." | ||
"lint": "eslint --cache src --ext .ts", | ||
"pretest": "npm run prepublishOnly && attw --pack", | ||
"test": "npm run lint && mocha --exit -t 5000 test/*.test.js", | ||
"ci": "c8 -r lcov -r text -r text-summary npm test", | ||
"prepublishOnly": "tshy && tshy-after" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"c8": "^7.14.0", | ||
"eslint": "^8.42.0", | ||
"eslint-config-egg": "^12.2.1", | ||
"mm": "^3.3.0", | ||
"mocha": "^10.2.0", | ||
"should": "*" | ||
"@arethetypeswrong/cli": "^0.15.3", | ||
"@eggjs/tsconfig": "1", | ||
"@types/mocha": "10", | ||
"@types/node": "20", | ||
"c8": "^10.1.2", | ||
"eslint": "8", | ||
"eslint-config-egg": "13", | ||
"mm": "3", | ||
"mocha": "^10.4.0", | ||
"tshy": "1", | ||
"tshy-after": "1", | ||
"typescript": "5" | ||
}, | ||
@@ -26,8 +33,6 @@ "homepage": "https://github.com/node-modules/sendmessage", | ||
"type": "git", | ||
"url": "git://github.com/node-modules/sendmessage.git", | ||
"web": "https://github.com/node-modules/sendmessage" | ||
"url": "git://github.com/node-modules/sendmessage.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/node-modules/sendmessage/issues", | ||
"email": "fengmk2@gmail.com" | ||
"url": "https://github.com/node-modules/sendmessage/issues" | ||
}, | ||
@@ -41,7 +46,32 @@ "keywords": [ | ||
], | ||
"engines": { | ||
"node": ">= 14.17.0" | ||
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)", | ||
"license": "MIT", | ||
"type": "module", | ||
"tshy": { | ||
"exports": { | ||
".": "./src/index.ts", | ||
"./package.json": "./package.json" | ||
} | ||
}, | ||
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)", | ||
"license": "MIT" | ||
"exports": { | ||
".": { | ||
"import": { | ||
"source": "./src/index.ts", | ||
"types": "./dist/esm/index.d.ts", | ||
"default": "./dist/esm/index.js" | ||
}, | ||
"require": { | ||
"source": "./src/index.ts", | ||
"types": "./dist/commonjs/index.d.ts", | ||
"default": "./dist/commonjs/index.js" | ||
} | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"types": "./dist/commonjs/index.d.ts", | ||
"main": "./dist/commonjs/index.js" | ||
} |
@@ -1,10 +0,6 @@ | ||
sendmessage | ||
======= | ||
# sendmessage | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![Test coverage][coveralls-image]][coveralls-url] | ||
[![Gittip][gittip-image]][gittip-url] | ||
[![David deps][david-image]][david-url] | ||
[![node version][node-image]][node-url] | ||
[](https://github.com/node-modules/sendmessage/actions/workflows/nodejs.yml) | ||
[![Test coverage][codecov-image]][codecov-url] | ||
[![npm download][download-image]][download-url] | ||
@@ -14,14 +10,6 @@ | ||
[npm-url]: https://npmjs.org/package/sendmessage | ||
[travis-image]: https://img.shields.io/travis/node-modules/sendmessage.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/node-modules/sendmessage | ||
[coveralls-image]: https://img.shields.io/coveralls/node-modules/sendmessage.svg?style=flat-square | ||
[coveralls-url]: https://coveralls.io/r/node-modules/sendmessage?branch=master | ||
[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square | ||
[gittip-url]: https://www.gittip.com/fengmk2/ | ||
[david-image]: https://img.shields.io/david/node-modules/sendmessage.svg?style=flat-square | ||
[david-url]: https://david-dm.org/node-modules/sendmessage | ||
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square | ||
[node-url]: http://nodejs.org/download/ | ||
[download-image]: https://img.shields.io/npm/dm/sendmessage.svg?style=flat-square | ||
[download-url]: https://npmjs.org/package/sendmessage | ||
[codecov-image]: https://codecov.io/gh/node-modules/sendmessage/branch/master/graph/badge.svg | ||
[codecov-url]: https://codecov.io/gh/node-modules/sendmessage | ||
@@ -34,3 +22,3 @@ Send a cross process message if message channel is connected. | ||
```bash | ||
$ npm install sendmessage --save | ||
npm install sendmessage --save | ||
``` | ||
@@ -42,8 +30,9 @@ | ||
```js | ||
var childprocess = require('child_process'); | ||
var sendmessage = require('sendmessage'); | ||
```ts | ||
import { fork } from 'node:child_process'; | ||
import sendmessage from 'sendmessage'; | ||
var worker = childprocess.fork('./worker.js'); | ||
sendmessage(worker, {hi: 'this is a message to worker'}); | ||
const worker = fork('./worker.js'); | ||
sendmessage(worker, { hi: 'this is a message to worker' }); | ||
``` | ||
@@ -53,6 +42,6 @@ | ||
```js | ||
var sendmessage = require('sendmessage'); | ||
```ts | ||
import sendmessage from 'sendmessage'; | ||
sendmessage(process, {hello: 'this is a message to master'}); | ||
sendmessage(process, { hello: 'this is a message to master' }); | ||
``` | ||
@@ -62,3 +51,3 @@ | ||
### #sendmessage(childprocess, message); | ||
### #sendmessage(childProcess, message) | ||
@@ -68,7 +57,7 @@ Send a cross process message. | ||
- childprocess: child process instance | ||
- childProcess: child process instance | ||
- message: the message need to send | ||
```js | ||
sendmessage(process, {hello: 'this is a message to master'}); | ||
sendmessage(process, { hello: 'this is a message to master' }); | ||
``` | ||
@@ -78,38 +67,10 @@ | ||
## Test | ||
```bash | ||
$ npm install | ||
$ npm test | ||
``` | ||
### Coverage | ||
```bash | ||
$ npm test-cov | ||
``` | ||
## License | ||
(The MIT License) | ||
[MIT](LICENSE) | ||
Copyright (c) 2014 - 2015 fengmk2 <fengmk2@gmail.com> and other contributors | ||
## Contributors | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'Software'), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
[](https://github.com/node-modules/sendmessage/graphs/contributors) | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Made with [contributors-img](https://contrib.rocks). |
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
17770
10
176
Yes
12
70
8
1