Socket
Socket
Sign inDemoInstall

npe

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npe - npm Package Compare versions

Comparing version 0.2.1 to 1.0.0

6

index.js

@@ -40,4 +40,6 @@ #!/usr/bin/env node

}
if (typeof(pkg.files) === "string") {
pkg.files = stringToArray(pkg.files);
}
Object.keys(pkg).forEach(function(property){

@@ -51,4 +53,4 @@ if (pkg[property] === "true") {

}
})
});
fs.writeFileSync(args.package, JSON.stringify(pkg, null, 2));
{
"name": "npe",
"version": "0.2.1",
"version": "1.0.0",
"description": "Node Package Editor: a CLI for one-off inspection and editing of properties in package.json files.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -31,4 +31,4 @@ # npe [![Build Status](https://travis-ci.org/zeke/npe.png?branch=master)](https://travis-ci.org/zeke/npe)

# If commas are present, they'll be the delimiter. Otherwise spaces.
npm keywords "foo, bar, cheese whiz"
npm keywords "foo bar baz"
npe keywords "foo, bar, cheese whiz"
npe keywords "foo bar baz"

@@ -35,0 +35,0 @@ # The current working directory's package.json is used by default,

@@ -6,3 +6,4 @@ 'use strict';

var util = require('util');
var path = require('path');
var fixturePath = path.join(__dirname, "fixtures/normal/package.json");
describe("npe", function() {

@@ -50,3 +51,3 @@

nixt()
.run('./index.js name --package test/fixtures/normal/package.json')
.run('./index.js name --package ' + fixturePath)
.stdout("normal")

@@ -58,3 +59,3 @@ .end(done);

nixt()
.run('./index.js scripts --package test/fixtures/normal/package.json')
.run('./index.js scripts --package ' + fixturePath)
.stdout(/tape/)

@@ -66,3 +67,3 @@ .end(done);

nixt()
.run('./index.js scripts.test --package test/fixtures/normal/package.json')
.run('./index.js scripts.test --package ' + fixturePath)
.stdout("tape")

@@ -81,3 +82,3 @@ .end(done);

nixt()
.run("cp test/fixtures/normal/package.json " + tmpFile)
.run("cp " + fixturePath +" " + tmpFile)
.end(done);

@@ -172,2 +173,57 @@ });

it("sets files array from a comma-delimited string", function(done) {
nixt()
.expect(function(result){
pkg = require(tmpFile);
if (!util.isArray(pkg.files)) {
console.log(pkg.files);
return new Error('files should be an array');
}
if (pkg.files.length !== 2) {
console.log(pkg.files);
return new Error('files should have two elements');
}
if (pkg.files[0] !== "bin/") {
console.log(pkg.files);
return new Error('first keyword should be bin/');
}
})
.run("./index.js files \"bin/, lib/\" --package="+tmpFile)
.end(done);
});
it("sets files array from a space-delimited string", function(done) {
nixt()
.expect(function(result){
pkg = require(tmpFile);
if (!util.isArray(pkg.files)) {
console.log(pkg.files);
return new Error('files should be an array');
}
if (pkg.files.length !== 2) {
console.log(pkg.files);
return new Error('files should have two elements');
}
if (pkg.files[0] !== "bin/") {
console.log(pkg.files);
return new Error('first keyword should be bin/');
}
if (pkg.files[1] !== "lib/") {
console.log(pkg.files);
return new Error('last keyword should be lib/');
}
})
.run("./index.js files \"bin/ lib/\" --package="+tmpFile)
.end(done);
});
it("sets 'false' string to a boolean false", function(done) {

@@ -174,0 +230,0 @@ nixt()

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