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

file-save

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-save - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.travis.yml

18

index.js

@@ -8,8 +8,8 @@ var fs = require('fs'),

if(arguments.length < 4) {
file_path = file_path;
data = data;
options = null;
cb = arguments[2];
file_path = file_path;
data = data;
cb = options
options = null;
}else if (arguments.length < 3) {
throw Error('Arguments should be three or four.')
throw Error('Arguments should be three or four.')
}

@@ -22,3 +22,3 @@ dir_url= path.dirname(file_path)

_create_fs(dir_path, function() {
_file_write(ori_path, data, options, cb)
_file_write(ori_path, data, options, cb)
})

@@ -36,7 +36,7 @@ }

function _file_write(dir, data, opt, cb) {
fs.writeFile(dir, data, opt, function(err) {
fs.writeFile(dir, data, opt, function(err) {
if(err)
throw Error(err)
cb(null)
throw Error(err)
cb(null)
})
}
{
"name": "file-save",
"version": "0.1.0",
"version": "0.1.1",
"description": "auto create path and just save the file!",

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

# Save file
[![Build Status](https://travis-ci.org/chilijung/file-save.png)](https://travis-ci.org/chilijung/file-save)
Just save the file!!!! Auto create folder path and just save the file.

@@ -4,0 +6,0 @@

var should = require('should');
var fs = require('fs');
var fileSave = require('./');
describe('should save to the file', function() {
it('should save to sample folder', function() {
describe('should save the file test', function() {
it('should save to sample folder', function(cb) {
fileSave('sample/test', 'hello world', function(result) {
should.not.exist(result);
should.not.exist(result);
cb();
})
})
it('should read the data in sample/test', function(cb) {
fs.readFile(__dirname + '/sample/test', {encoding: 'utf-8'}, function(err, data) {
if(err)
throw err;
data.should.equal('hello world');
cb()
})
})
})

Sorry, the diff of this file is not supported yet

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