npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

spawn-package

v0.1.1

Published

Spawns executables registered by `package.json`

Downloads

4

Readme

spawn-package

npm version

Spawns executables registered by package.json. Works with both global and local packages, on any package managers.

Install

$ npm install spawn-package

Usage

var spawnPackage = require('spawn-package');

spawnPackage({
  package: 'gulp',
});

spawnPackage({
  package: 'webpack',
  args: ['--env.production'],
})

API

spawnPackage(options)

Spawns executables registered by package.json. Returns instance of ChildProcess.

options.package

Required, string

The name of the package where the executable to run belongs

options.bin

Optional, string

The name of binary defined in package.json. This will be set to package if not specified.

options.args

Optional, string[]

List of string arguments passed to the spawned process

options.cwd

Optional, string

Current working directory of the spawned process

options.env

Optional, Object

Environment key-value pairs

options.argv0

Optional, string

Explicitly sets the value of argv[0] sent to the child process. This will be set to the full path of the executable if not specified.

options.stdio

Optional, Array | string

Child's stdio configuration (see Node.js docs)

options.detached

Optional, boolean

Prepares child to run independently of its parent process (see Node.js docs).

options.uid

Optional, number

Sets the user identity of the process (see setuid(2)).

options.gid

Optional, number

Sets the group identity of the process (see setuid(2)).

options.shell

Optional, boolean | string

If true, runs command inside of a shell. Uses '/bin/sh' on UNIX, and process.env.ComSpec on Windows. A different shell can be specified as a string. See Shell Requirements and Default Windows Shell.

License

MIT