Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "cd", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "chdir in chainer fashion + read file", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,13 +24,13 @@ cd? cd | ||
var Cd = require('cd'); | ||
var cd = new Cd('.'); | ||
var cd = require('cd'); | ||
var dir = new cd('.'); | ||
// Read lol.json from current directory | ||
var lol = cd('lol.json'); | ||
var lol = dir('lol.json'); | ||
// Read wtf.js from test directory. | ||
var wtf = cd().test('wtf.js'); | ||
var wtf = dir().test('wtf.js'); | ||
// Chain as you like | ||
var file = cd().dir1().dir2(file_in_dir2); | ||
var file = dir().dir1().dir2(file_in_dir2); | ||
@@ -41,3 +41,3 @@ /* | ||
try { | ||
content = cd().existDir1().nonexistDir().existDir2(file2); | ||
content = dir().existDir1().nonexistDir().existDir2(file2); | ||
} catch(e) { | ||
@@ -44,0 +44,0 @@ // ... |
10
test.js
@@ -1,11 +0,11 @@ | ||
var Cd = require('./index.js'); | ||
var cd = Cd('.'); | ||
var cd = require('./index.js'); | ||
var dir = cd('.'); | ||
var output = cd().test('oh.txt'); | ||
var output = dir().test('oh.txt'); | ||
console.log('oh.txt:'+output); | ||
var output = cd().test('lol.js'); | ||
var output = dir().test('lol.js'); | ||
output = cd().test('wtf.json'); | ||
output = dir().test('wtf.json'); | ||
console.log('wtf.json:'+JSON.stringify(output)); | ||
@@ -1,1 +0,6 @@ | ||
This is oh.txt file. | ||
This is oh.txt file line 1. | ||
This is oh.txt file line 2. | ||
This is oh.txt file line 3. | ||
This is oh.txt file line 4. | ||
This is oh.txt file line 5. | ||
This is oh.txt file line 6. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4994