Skip to content

Commit 6bcf587

Browse files
committed
Bump to 2.0
1 parent ccb6c2a commit 6bcf587

File tree

14 files changed

+51
-42
lines changed

14 files changed

+51
-42
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ The Node-RED admin command line interface.
77

88
A command line tool for remotely administering Node-RED.
99

10+
It is built into `node-red` and can be run as:
11+
12+
node-red admin ....
13+
14+
15+
## Standalone install
16+
1017
Install this globally to make the `node-red-admin` command available on your path:
1118

1219
npm install -g node-red-admin
@@ -39,4 +46,4 @@ By default, the tool stores its configuration in `~/.node-red/.cli-config.json`.
3946
can specify a different directory for the config file using the `--userDir` argument.
4047

4148
The `--json` option causes the tool to format its output as JSON making it suitable
42-
for scripting.
49+
for scripting.

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-admin",
3-
"version": "0.2.7",
3+
"version": "2.0.0",
44
"description": "The Node-RED admin command line interface",
55
"homepage": "http://nodered.org",
66
"bugs": {
@@ -13,7 +13,7 @@
1313
},
1414
"main": "lib/index.js",
1515
"engines": {
16-
"node": ">=8"
16+
"node": ">=12"
1717
},
1818
"contributors": [
1919
{
@@ -38,12 +38,13 @@
3838
"grunt-cli": "^1.3.2",
3939
"grunt-contrib-jshint": "^3.0.0",
4040
"grunt-simple-mocha": "^0.4.1",
41-
"mocha": "^7.1.0",
42-
"should": "^13.2.3",
43-
"sinon": "1.17.7"
41+
"mocha": "9.0.0",
42+
"should": "13.2.3",
43+
"sinon": "11.1.1",
44+
"sinon-test": "^3.1.0"
4445
},
4546
"optionalDependencies": {
46-
"bcrypt": "3.0.8"
47+
"bcrypt": "5.0.1"
4748
},
4849
"bin": {
4950
"node-red-admin": "node-red-admin.js"

test/lib/commands/disable_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("commands/disable", function() {
3232

3333
it('disables a node', function(done) {
3434
var error;
35-
sinon.stub(request,"request",function(path,opts) {
35+
sinon.stub(request,"request").callsFake(function(path,opts) {
3636
try {
3737
should(path).be.eql("/nodes/testnode");
3838
opts.should.eql({

test/lib/commands/enable_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("commands/enable", function() {
3232

3333
it('enables a node', function(done) {
3434
var error;
35-
sinon.stub(request,"request",function(path,opts) {
35+
sinon.stub(request,"request").callsFake(function(path,opts) {
3636
try {
3737
should(path).be.eql("/nodes/testnode");
3838
opts.should.eql({

test/lib/commands/hash_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("commands/hash-pw", function() {
3434
prompt.read.restore();
3535
});
3636
it('generates a bcrypt hash of provided password',function(done) {
37-
sinon.stub(prompt,"read",function(opts,callback) {
37+
sinon.stub(prompt,"read").callsFake(function(opts,callback) {
3838
callback(null,"a-test-password");
3939
});
4040

@@ -48,7 +48,7 @@ describe("commands/hash-pw", function() {
4848
});
4949
});
5050
it('ignores blank password',function(done) {
51-
sinon.stub(prompt,"read",function(opts,callback) {
51+
sinon.stub(prompt,"read").callsFake(function(opts,callback) {
5252
callback(null,"");
5353
});
5454

@@ -58,7 +58,7 @@ describe("commands/hash-pw", function() {
5858
});
5959
});
6060
it('ignores null password',function(done) {
61-
sinon.stub(prompt,"read",function(opts,callback) {
61+
sinon.stub(prompt,"read").callsFake(function(opts,callback) {
6262
callback(null,null);
6363
});
6464

test/lib/commands/info_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("commands/info", function() {
3232

3333
it('displays information on a module', function(done) {
3434
var error;
35-
sinon.stub(request,"request",function(path,opts) {
35+
sinon.stub(request,"request").callsFake(function(path,opts) {
3636
try {
3737
should(path).be.eql("/nodes/testnode");
3838
opts.should.eql({});
@@ -52,7 +52,7 @@ describe("commands/info", function() {
5252

5353
it('reports error', function(done) {
5454
var error;
55-
sinon.stub(request,"request",function(path,opts) {
55+
sinon.stub(request,"request").callsFake(function(path,opts) {
5656
try {
5757
should(path).be.eql("/nodes/testnode");
5858
opts.should.eql({});

test/lib/commands/install_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("commands/install", function() {
3232

3333
it('installs a node', function(done) {
3434
var error;
35-
sinon.stub(request,"request",function(path,opts) {
35+
sinon.stub(request,"request").callsFake(function(path,opts) {
3636
try {
3737
should(path).be.eql("/nodes");
3838
opts.should.eql({

test/lib/commands/list_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("commands/list", function() {
2929

3030
it('lists all nodes', function(done) {
3131
var error;
32-
sinon.stub(request,"request",function(path,opts) {
32+
sinon.stub(request,"request").callsFake(function(path,opts) {
3333
try {
3434
should(path).be.eql("/nodes");
3535
opts.should.eql({});

test/lib/commands/login_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ var result = require("./result_helper");
2727

2828
describe("commands/list", function() {
2929
beforeEach(function() {
30-
sinon.stub(config,"tokens",function(token) {});
31-
sinon.stub(prompt,"read",function(opts,callback) {
30+
sinon.stub(config,"tokens").callsFake(function(token) {});
31+
sinon.stub(prompt,"read").callsFake(function(opts,callback) {
3232
if (/Username/.test(opts.prompt)) {
3333
callback(null,"username");
3434
} else if (/Password/.test(opts.prompt)) {

test/lib/commands/remove_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("commands/remove", function() {
3232

3333
it('removes a node', function(done) {
3434
var error;
35-
sinon.stub(request,"request",function(path,opts) {
35+
sinon.stub(request,"request").callsFake(function(path,opts) {
3636
try {
3737
should(path).be.eql("/nodes/testnode");
3838
opts.should.eql({

0 commit comments

Comments
 (0)