Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
83bcdc4eb0 | |||
5c2f318158 | |||
e8043c5734 | |||
b9805efa57 | |||
a52a4ab7fd | |||
ea609f83d7 | |||
3db25512ee | |||
5c2e3fea6c | |||
7e5178d825 | |||
9795489d67 | |||
28733cbd73 | |||
f12335ea62 | |||
f12a92660f | |||
c81800cfab | |||
05b94469b5 | |||
eda415893c | |||
630b7661d9 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,8 +15,6 @@ node_modules/
|
|||||||
|
|
||||||
# builds
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_web/
|
dist_*/
|
||||||
dist_serve/
|
|
||||||
dist_ts_web/
|
|
||||||
|
|
||||||
# custom
|
# custom
|
115
.gitlab-ci.yml
115
.gitlab-ci.yml
@ -1,79 +1,84 @@
|
|||||||
# gitzone ci_default
|
# gitzone ci_default
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
variables:
|
|
||||||
GIT_STRATEGY: clone
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- npm install -g @shipzone/npmci
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
# ====================
|
# ====================
|
||||||
mirror:
|
auditProductionDependencies:
|
||||||
stage: security
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
script:
|
|
||||||
- npmci git mirror
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
snyk:
|
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
- npmci command npm install --production --ignore-scripts
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command snyk test
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
allow_failure: true
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- priv
|
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command npm run build
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# metadata stage
|
# metadata stage
|
||||||
@ -81,35 +86,37 @@ release:
|
|||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g typescript
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-dbase:npmci
|
|
||||||
services:
|
|
||||||
- docker:18-dind
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci node install stable
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command tsdoc
|
- npmci command npm run buildDocs
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
@ -117,5 +124,5 @@ pages:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "npm test",
|
||||||
|
"name": "Run npm test",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
52
README.md
52
README.md
@ -1,52 +0,0 @@
|
|||||||
# @pushrocks/smartspawn
|
|
||||||
smart subprocess handling
|
|
||||||
|
|
||||||
## Availabililty and Links
|
|
||||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartspawn)
|
|
||||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartspawn)
|
|
||||||
* [github.com (source mirror)](https://github.com/pushrocks/smartspawn)
|
|
||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartspawn/)
|
|
||||||
|
|
||||||
## Status for master
|
|
||||||
[](https://gitlab.com/pushrocks/smartspawn/commits/master)
|
|
||||||
[](https://gitlab.com/pushrocks/smartspawn/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/@pushrocks/smartspawn)
|
|
||||||
[](https://snyk.io/test/npm/@pushrocks/smartspawn)
|
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
|
||||||
[](https://prettier.io/)
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
|
||||||
|
|
||||||
### Understand the Purpose
|
|
||||||
|
|
||||||
smartipc makes it easy to spawn tasks into subprocesses without loosing control over what those processes do.
|
|
||||||
You can transparently call functions and expect returned data using promises.
|
|
||||||
|
|
||||||
### How To
|
|
||||||
|
|
||||||
**Master.ts:**
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import * as smartspawn from 'smartspawn';
|
|
||||||
smartspawn.setBasePathArg(__dirname); // if you want to avoid typings out full paths every time
|
|
||||||
|
|
||||||
let myThread = new smartspawn.Thread('worker');
|
|
||||||
myThread.send('someMessageOrObject').then(messageResponse => {
|
|
||||||
console.log(messageResponse);
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
**worker.ts**
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
```
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this readme.
|
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
|
@ -1,2 +1,2 @@
|
|||||||
require('@gitzone/tsrun');
|
require('@git.zone/tsrun');
|
||||||
require('spawn-wrap').runMain()
|
require('spawn-wrap').runMain()
|
@ -9,13 +9,27 @@
|
|||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
},
|
},
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "code.foss.global",
|
||||||
"gitscope": "pushrocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "smartspawn",
|
"gitrepo": "smartspawn",
|
||||||
"shortDescription": "smart subprocess handling",
|
"description": "A node module for smart subprocess handling with support for promises and streamlined subprocess communication.",
|
||||||
"npmPackagename": "@pushrocks/smartspawn",
|
"npmPackagename": "@push.rocks/smartspawn",
|
||||||
"license": "MIT"
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"subprocess",
|
||||||
|
"child_process",
|
||||||
|
"spawn",
|
||||||
|
"threading",
|
||||||
|
"multithreading",
|
||||||
|
"process management",
|
||||||
|
"async",
|
||||||
|
"promise"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"tsdoc": {
|
||||||
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
15224
package-lock.json
generated
15224
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
64
package.json
64
package.json
@ -1,48 +1,62 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartspawn",
|
"name": "@push.rocks/smartspawn",
|
||||||
"version": "2.0.7",
|
"version": "3.0.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "smart subprocess handling",
|
"description": "A node module for smart subprocess handling with support for promises and streamlined subprocess communication.",
|
||||||
"main": "dist/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild)"
|
"build": "(tsbuild --web --allowimplicitany)",
|
||||||
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+ssh://git@gitlab.com/pushrocks/smartipc.git"
|
"url": "https://code.foss.global/push.rocks/smartspawn.git"
|
||||||
},
|
},
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/pushrocks/smartipc/issues"
|
"url": "https://gitlab.com/pushrocks/smartipc/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/smartipc#README",
|
"homepage": "https://code.foss.global/push.rocks/smartspawn",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@push.rocks/smartpromise": "^4.0.3",
|
||||||
"spawn-wrap": "^1.4.2",
|
"spawn-wrap": "^2.0.0",
|
||||||
"threads": "1.0.0-beta.4",
|
"threads": "1.7.0",
|
||||||
"tiny-worker": "^2.2.0"
|
"tiny-worker": "^2.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.11",
|
"@git.zone/tsbuild": "^2.1.11",
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@git.zone/tsrun": "^1.2.8",
|
||||||
"@gitzone/tstest": "^1.0.24",
|
"@git.zone/tstest": "^1.0.24",
|
||||||
"@pushrocks/tapbundle": "^3.0.11",
|
"@push.rocks/tapbundle": "^5.0.4",
|
||||||
"@types/node": "^12.7.2",
|
"@types/node": "^20.12.12"
|
||||||
"tslint": "^5.19.0",
|
|
||||||
"tslint-config-prettier": "^1.18.0"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/*",
|
"ts/**/*",
|
||||||
"ts_web/*",
|
"ts_web/**/*",
|
||||||
"dist/*",
|
"dist/**/*",
|
||||||
"dist_web/*",
|
"dist_*/**/*",
|
||||||
"dist_ts_web/*",
|
"dist_ts/**/*",
|
||||||
"assets/*",
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"subprocess",
|
||||||
|
"child_process",
|
||||||
|
"spawn",
|
||||||
|
"threading",
|
||||||
|
"multithreading",
|
||||||
|
"process management",
|
||||||
|
"async",
|
||||||
|
"promise"
|
||||||
]
|
]
|
||||||
}
|
}
|
6651
pnpm-lock.yaml
generated
Normal file
6651
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
120
readme.md
Normal file
120
readme.md
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
Given the provided files and their contents, the comprehensive documentation for using **`@push.rocks/smartspawn`** with TypeScript and in a manner that provides thorough examples and descriptions of features and scenarios is extensive. However, I'll outline a concise and informative usage guide that can serve as a helpful starting point. For an in-depth understanding and a complete reference to all features, further reading, exploration, and experimentation with the library are recommended.
|
||||||
|
|
||||||
|
# @push.rocks/smartspawn
|
||||||
|
smart subprocess handling
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
To install `@push.rocks/smartspawn`, open your terminal and run the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @push.rocks/smartspawn
|
||||||
|
```
|
||||||
|
|
||||||
|
This command fetches the package from npm and adds it to your project's dependencies.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
This guide uses TypeScript and ESM syntax to demonstrate how to utilize `@push.rocks/smartspawn` for smart subprocess handling in your application.
|
||||||
|
|
||||||
|
First, ensure that your TypeScript environment is set up to support ECMAScript modules (ESM). Your `tsconfig.json` should include:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "ESNext",
|
||||||
|
"target": "ESNext",
|
||||||
|
"moduleResolution": "node"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Starting and Stopping a Simple Thread
|
||||||
|
|
||||||
|
`ThreadSimple` class allows you to manage subprocesses effectively. Here's how to start and stop a simple thread:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Import the necessary components from the library
|
||||||
|
import { ThreadSimple } from '@push.rocks/smartspawn';
|
||||||
|
|
||||||
|
// Define a function that creates, starts, and stops a thread
|
||||||
|
async function demonstrateThreadSimple() {
|
||||||
|
// Create an instance of ThreadSimple
|
||||||
|
const mySimpleThread = new ThreadSimple('./path/to/worker.js');
|
||||||
|
|
||||||
|
// Start the thread
|
||||||
|
await mySimpleThread.start();
|
||||||
|
console.log('Thread has started.');
|
||||||
|
|
||||||
|
// Stop the thread
|
||||||
|
await mySimpleThread.stop();
|
||||||
|
console.log('Thread has stopped.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call the function to demonstrate its functionality
|
||||||
|
demonstrateThreadSimple();
|
||||||
|
```
|
||||||
|
|
||||||
|
The `./path/to/worker.js` should be the path to your worker script that you want to execute in a separate process.
|
||||||
|
|
||||||
|
### Wrapping Processes
|
||||||
|
|
||||||
|
`smartspawn` also provides functionality to wrap subprocesses, allowing you to modify or set up an environment before execution. Here's how to wrap and unwrap subprocesses:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { startSpawnWrap, endSpawnWrap } from '@push.rocks/smartspawn';
|
||||||
|
|
||||||
|
// Start a wrap
|
||||||
|
startSpawnWrap('path/to/script', ['arg1', 'arg2'], { ENV_VAR: 'value' });
|
||||||
|
console.log('Subprocess wrapped.');
|
||||||
|
|
||||||
|
// End the wrap when it's no longer needed
|
||||||
|
endSpawnWrap();
|
||||||
|
console.log('Subprocess unwrapped.');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Advanced Thread Management
|
||||||
|
|
||||||
|
`@push.rocks/smartspawn` integrates with the `threads` package to provide advanced threading capabilities. Here's a brief example showing how you might utilize it for more complex scenarios:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { Thread, spawn, Worker } from 'threads';
|
||||||
|
|
||||||
|
async function advancedThreadExample() {
|
||||||
|
const thread = await spawn(new Worker('./worker'));
|
||||||
|
|
||||||
|
const result = await thread.doWork();
|
||||||
|
console.log(`Result from thread: ${result}`);
|
||||||
|
|
||||||
|
await Thread.terminate(thread);
|
||||||
|
}
|
||||||
|
|
||||||
|
advancedThreadExample();
|
||||||
|
```
|
||||||
|
|
||||||
|
Ensure you explore the `threads` documentation for a more detailed understanding of creating workers and communicating between the main process and threads.
|
||||||
|
|
||||||
|
### Conclusion
|
||||||
|
|
||||||
|
The `@push.rocks/smartspawn` package simplifies managing subprocesses in your Node.js applications, offering straightforward APIs for starting, stopping, and communicating with child processes. Whether you need to execute a simple script in the background or leverage sophisticated multi-threading capabilities, `smartspawn` provides the tools necessary to implement these features efficiently and robustly.
|
||||||
|
|
||||||
|
Remember, the examples above are starting points. Review the source code, tests, and type declarations for a comprehensive understanding of everything `@push.rocks/smartspawn` and its integrated packages can do. Experiment with the library in your projects to best learn how to utilize its full potential in real-world applications.
|
||||||
|
|
||||||
|
## License and Legal Information
|
||||||
|
|
||||||
|
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||||
|
|
||||||
|
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
### Trademarks
|
||||||
|
|
||||||
|
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
||||||
|
|
||||||
|
### Company Information
|
||||||
|
|
||||||
|
Task Venture Capital GmbH
|
||||||
|
Registered at District court Bremen HRB 35230 HB, Germany
|
||||||
|
|
||||||
|
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
||||||
|
|
||||||
|
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
@ -1,7 +1,7 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@push.rocks/tapbundle';
|
||||||
|
|
||||||
import * as smartspawn from '../ts/index';
|
import * as smartspawn from '../ts/index.js';
|
||||||
|
|
||||||
tap.test('should create a simple test function', async () => {});
|
tap.test('should create a simple test function', async () => {});
|
||||||
|
|
||||||
tap.start();
|
export default tap.start();
|
||||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* autocreated commitinfo by @pushrocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
name: '@push.rocks/smartspawn',
|
||||||
|
version: '3.0.3',
|
||||||
|
description: 'A node module for smart subprocess handling with support for promises and streamlined subprocess communication.'
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
export * from './smartspawn.classes.threadsimple';
|
export * from './smartspawn.classes.threadsimple.js';
|
||||||
export * from './smartspawn.wrap';
|
export * from './smartspawn.wrap.js';
|
||||||
|
|
||||||
export * from 'threads';
|
export * from 'threads';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from './smartspawn.plugins';
|
import * as plugins from './smartspawn.plugins.js';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
import * as childProcess from 'child_process';
|
import * as childProcess from 'child_process';
|
||||||
|
|
||||||
export class ThreadSimple {
|
export class ThreadSimple {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as plugins from './smartspawn.plugins';
|
import * as plugins from './smartspawn.plugins.js';
|
||||||
|
|
||||||
export const packageBase = plugins.path.join(__dirname, '../');
|
export const packageBase = plugins.path.join(__dirname, '../');
|
||||||
export const typescriptwrapJs = plugins.path.join(packageBase, 'assets/typescriptwrap.js');
|
export const typescriptwrapJs = plugins.path.join(packageBase, 'assets/typescriptwrap.js');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
const threads = require('threads');
|
import * as threads from 'threads';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
|
|
||||||
export { path, smartpromise, threads };
|
export { path, smartpromise, threads };
|
||||||
|
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"verbatimModuleSyntax": true
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"dist_*/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
17
tslint.json
17
tslint.json
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"semicolon": [true, "always"],
|
|
||||||
"no-console": false,
|
|
||||||
"ordered-imports": false,
|
|
||||||
"object-literal-sort-keys": false,
|
|
||||||
"member-ordering": {
|
|
||||||
"options":{
|
|
||||||
"order": [
|
|
||||||
"static-method"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultSeverity": "warning"
|
|
||||||
}
|
|
Reference in New Issue
Block a user