Socket
Socket
Sign inDemoInstall

junodechild

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

junodechild

Used to create new thread.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

ju Node Child

For the processes that lock main thread.

Installation

$ npm install junodechild

Usage

var nodeChild = require("junodechild");

nodeChild.get({
    fn: function (message) {
        for (var i = 0; i < 9999999999; i++) {}

        // Used to write any strig to console.txt.
        this.log(message + "\n" + new Date().toISOString());

        // This is end of thread. This method will close child thread and then returns parameter.
        this.end(i);
    },
    // Only values in JSON format can be sent.
    params: ["This is a parameter."],
    cb: function (i) {
        console.log(
            "Processing Time: " +
              Math.abs((new Date().getTime() - sd.getTime()) / 1000) +
              "ms " +
              "Variable i value: " + i
        );
    },
    ecb: function (err) {
        console.log(err);
    }
});

Methods

nodeChild.set([options]) or nodeChild.set(key, value)

Parameters:

  • [options]: Optional object containing any of the following properties:

    • [childConsolePath]: Console file path of the node child for test or debuging.

Or

  • key: String key names of the above properties (childConsolePath).

  • value: Value of the above properties (childConsolePath).

nodeChild.get([options])

Parameters:

  • [options]: The object containing of the following properties:

    • [params]: Optional parameters of function to be executed in another node child. It must be an array when used.

    • [fn]: Function to be executed in another node child. If the params is exist, it is written to the parameters of the function respectively.

    • [cb]: Optional callback function to be run after the end of the node child.

    • [ecb]: Optional error callback function to be run when the node child throws an error.

this.log(message)
  • message: String message to be log.
this.end(data)

To close the node child.

  • data: Optional data to be sent for the callback function.

Examples

Basic Usage

This example shows the most basic way of usage.

License

This software is free to use under the JosephUz. See the LICENSE file for license text and copyright information.

Keywords

FAQs

Package last updated on 01 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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