This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

pkg-ci

2.0.1 • Public • Published

pkg-ci

circle-status

js-standard-style 

zeit/pkg gives you the awesome ability to package your node app in a single executable binary. But if you have tests, you need to run them before you package your binary. This is fine for local development, but what if you want to run tests within a CI/CD environment against a previously packaged binary (avoid npm install perhaps)? pkg-ci allows you to do this.

TL;DR

Got a binary generated with zeit/pkg and you want to run your tests instead of running your app?

CI_MODE=true ./app

Run the app as usual

CI_MODE=false

Install

npm install pkg-ci

Usage

Create an entry file for your app entry.js (or whatever you want to call it). Require pkg-ci and point it to your app's package.json file

const path = require('path')
require('pkg-ci')(path.join(__dirname, './package.json'))

When you run your pkg build step, point it to entry.js

pkg entry.js --output ./out

Ensure your package.json has the appropriate npm start script defined

After you have compiled your binary, whenever your binary is run with CI_MODE=true your app will not run, instead, your npm test script will run. Anything else will run your app as usual.

Credits

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i pkg-ci

Weekly Downloads

0

Version

2.0.1

License

MIT

Last publish

Collaborators

  • recursivefunk