Comparing version 0.2.6 to 1.0.0
@@ -80,3 +80,3 @@ #!/usr/bin/env node | ||
if (sync.isFile(file)) { | ||
var content = sync.read(file); | ||
var content = sync.read(file, options); | ||
@@ -186,3 +186,3 @@ if (options.force || !sync.exists(dest)) { | ||
contents = node_fs.readFileSync(String(filepath)); | ||
contents = node_fs.readFileSync(filepath, options); | ||
// If encoding is not explicitly null, convert from encoded buffer to a | ||
@@ -229,2 +229,4 @@ // string. If no encoding was specified, use the default. | ||
console.log('is buffer', Buffer.isBuffer(contents)) | ||
// If contents is already a Buffer, don't try to encode it. If no encoding | ||
@@ -231,0 +233,0 @@ // was specified, use the default. |
{ | ||
"name": "fs-sync", | ||
"version": "0.2.6", | ||
"version": "1.0.0", | ||
"description": "synchronous fs with more fun", | ||
"main": "dist/index", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha --reporter spec ./test/*.js" | ||
}, | ||
@@ -39,11 +39,13 @@ "author": "kael", | ||
"dependencies": { | ||
"mkdirp": "~0.3.5", | ||
"iconv-lite": "~0.2.10", | ||
"lodash": "~1.2.1", | ||
"glob": "~4.0.4", | ||
"rimraf": "~2.1.4" | ||
"mkdirp": "^0.3.5", | ||
"iconv-lite": "^0.2.10", | ||
"lodash": "^1.2.1", | ||
"glob": "^4.0.4", | ||
"rimraf": "^2.1.4" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1" | ||
"chai": "^3.4.0", | ||
"mocha": "^2.3.3", | ||
"tmp": "0.0.28" | ||
} | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
[](https://travis-ci.org/kaelzhang/node-fs-sync) | ||
# fs-sync | ||
@@ -2,0 +4,0 @@ |
@@ -1,7 +0,45 @@ | ||
var fs = require('fs-sync'); | ||
var path = require('path'); | ||
'use strict'; | ||
var a = path.join(__dirname, 'a/'); | ||
var b = path.join(__dirname, 'b/'); | ||
var expect = require('chai').expect; | ||
var node_path = require('path'); | ||
var fs = require('fs'); | ||
var sync = require('../'); | ||
var tmp = require('tmp'); | ||
fs.copy(a, b, {force: true}); | ||
var root = node_path.join(__dirname, 'fixtures'); | ||
var cases = [ | ||
{ | ||
desc: 'should not corrupts binary files', | ||
file: 'icon.png' | ||
} | ||
]; | ||
describe("fs.copy()", function(){ | ||
cases.forEach(function (c) { | ||
var i = c.only | ||
? it.only | ||
: it; | ||
function run (noOptions) { | ||
i(c.desc, function (done) { | ||
tmp.dir(function (err, dir) { | ||
if (err) { | ||
expect('failed to create tmp dir').to.equal(''); | ||
return done() | ||
} | ||
var file = node_path.join(root, c.file); | ||
var tmp_file = node_path.join(root, c.file); | ||
sync.copy(file, tmp_file); | ||
expect(fs.readFileSync(file).toString()).to.equal(fs.readFileSync(tmp_file).toString()); | ||
done() | ||
}) | ||
}); | ||
} | ||
run(); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12909
213
1
152
2
0
3
7
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@4.5.37.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedlodash@1.3.1(transitive)
+ Addedminimatch@2.0.103.1.2(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.7.1(transitive)
- Removedglob@4.0.6(transitive)
- Removedgraceful-fs@1.2.33.0.12(transitive)
- Removedlodash@1.2.1(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@1.0.0(transitive)
- Removednatives@1.1.6(transitive)
- Removedrimraf@2.1.4(transitive)
- Removedsigmund@1.0.1(transitive)
Updatedglob@^4.0.4
Updatediconv-lite@^0.2.10
Updatedlodash@^1.2.1
Updatedmkdirp@^0.3.5
Updatedrimraf@^2.1.4