Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cross-env

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-env - npm Package Compare versions

Comparing version 1.0.8 to 2.0.0

15

dist/index.js

@@ -31,5 +31,14 @@ 'use strict';

if (command) {
var proc = (0, _crossSpawn.spawn)(command, commandArgs, { stdio: 'inherit', env: env });
proc.on('exit', process.exit);
return proc;
var _ret = (function () {
var proc = (0, _crossSpawn.spawn)(command, commandArgs, { stdio: 'inherit', env: env });
process.on('SIGTERM', function () {
return proc.kill('SIGTERM');
});
proc.on('exit', process.exit);
return {
v: proc
};
})();
if (typeof _ret === 'object') return _ret.v;
}

@@ -36,0 +45,0 @@ }

{
"name": "cross-env",
"version": "1.0.8",
"version": "2.0.0",
"description": "Run commands that set environment variables across platforms",

@@ -47,3 +47,2 @@ "main": "src/index.js",

"istanbul": "0.3.21",
"manage-path": "2.0.0",
"mocha": "2.3.3",

@@ -69,2 +68,2 @@ "proxyquire": "1.7.2",

}
}
}

3

README.md

@@ -8,2 +8,3 @@ # cross-env

[![Code Coverage](https://img.shields.io/codecov/c/github/kentcdodds/cross-env.svg?style=flat-square)](https://codecov.io/github/kentcdodds/cross-env)
[![Dependencies][dependencyci-badge]][dependencyci]
[![Donate][donate-badge]][donate]

@@ -62,1 +63,3 @@

[donate]: http://kcd.im/donate
[dependencyci-badge]: https://dependencyci.com/github/kentcdodds/cross-env/badge?style=flat-square
[dependencyci]: https://dependencyci.com/github/kentcdodds/cross-env

@@ -11,2 +11,3 @@ import {spawn} from 'cross-spawn';

const proc = spawn(command, commandArgs, {stdio: 'inherit', env});
process.on('SIGTERM', () => proc.kill('SIGTERM'));
proc.on('exit', process.exit);

@@ -13,0 +14,0 @@ return proc;

@@ -5,3 +5,2 @@ import chai from 'chai';

import proxyquire from 'proxyquire';
import getPathVar from 'manage-path/dist/get-path-var';
import assign from 'lodash.assign';

@@ -11,3 +10,3 @@ chai.use(sinonChai);

const {expect} = chai;
const spawned = {on: sinon.spy()};
const spawned = {on: sinon.spy(), kill: sinon.spy()};
const proxied = {

@@ -70,5 +69,14 @@ 'cross-spawn': {

it(`should propage SIGTERM signal`, () => {
testEnvSetting({
FOO_ENV: 'foo=bar'
}, 'FOO_ENV="foo=bar"');
process.emit('SIGTERM');
expect(spawned.kill).to.have.been.calledWith('SIGTERM');
});
function testEnvSetting(expected, ...envSettings) {
const ret = crossEnv([...envSettings, 'echo', 'hello world']);
const env = {[getPathVar()]: process.env[getPathVar()]};
const env = {};
env.APPDATA = process.env.APPDATA;

@@ -75,0 +83,0 @@ assign(env, expected);

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