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

nodecid

v1.0.7

Published

Simple CI/CD process

Downloads

44

Readme

Simple CI/CD package for any application

package version package downloads standard-readme compliant package license

Integrate a simple CI/CD process into your application without the hassle.

NOTE: This package needs node installed to work

Requirements

  • Node JS Runtime and NPM: You need to have NodeJS and npm installed on the target machine for this package to work.
  • nodecid.config.json file: This package depends on a configuration file located in the root directory of your application.

Installation

To install this package globally just run:

npm install -g nodecid

To run the package directly run:

npx nodecid

This will download the package and run the binaries directly. After the first run it won't download the package again.

Usage

To run the package after installing it globally just run:

nodecid

Remember you must have a nodecid.config.json file located in your root directory else this will throw an error.

Configuration

Your nodecid.config.json file should look like this:

{
    "start": "node index.js",
    "preflight": ["npm run test", "npm run build"]
}

or

{
    "start": "node index.js",
    "preflight": "./preflight.sh"
}

Your preflight parameter can wither be an array of commands, or path to a shell script. This will run before every start commands.

Optionally you could include a redeploy_path in your config file:

{
    "start": "node index.js",
    "preflight": "./preflight.sh",
    "redeploy_path": "./REDEPLOY"
}

This will look for the file named REDEPLOY in your rood directory and watch that file. If the file is changed the application will be restarted, ie it will run the preflight command(s) and start command. If you ommit the redeploy_path a file named REDEPLOY will be created in your root directory.

You can change the name and path of the redeploy_path, just make sure the path is correct and the file name exists in the named path. Example:

{
    "start": "node index.js",
    "preflight": "./preflight.sh",
    "redeploy_path": "./deploy/trigger.txt"
}

NOTE: This also works for other languages, example:

{
    "start": "python app.py",
    "preflight": "./preflight.sh"
}

This app just runs whatever command you send it in an isolated child process, the command will be run as if being run in a terminal.

All Available options in nodecid.config.json file

  • start: string: The start Command
  • preflight: string | Array: Array of commands or shell script file to run before reloading application
  • postflight: string | Array: Optional: Array of commands or shell script file to run after reloading application
  • redeploy_path: string: Optional: The path to trigger a redeployment. Default ./REDEPLOY
  • port: string | number | (string | number)[]: Optional: A port(or array of ports) to kill if running a server. NOTE: it is important to provide this option if running a server else the process may not terminate properly
  • first_run: boolean: Optional: If the preflight should run on first run. Default false.

Redeployment

For continuos deployment and integration there needs to be a text file located in your project which the application can watch. Any time the content of this file is changed the application will rebuild and rerun your start command.