New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fs-sync

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-sync - npm Package Compare versions

Comparing version 0.2.6 to 1.0.0

test/fixtures/icon.png

6

index.js

@@ -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 @@

[![Build Status](https://travis-ci.org/kaelzhang/node-fs-sync.png?branch=master)](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();
});
});
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