Socket
Socket
Sign inDemoInstall

fs-extra

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-extra - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

lib/json.js

5

CHANGELOG.md

@@ -0,1 +1,6 @@

0.6.1 / 2013-05-14
------------------
* modified for `strict` mode, closes #24
* added `outputJson()/outputJsonSync()`, closes #23
0.6.0 / 2013-03-18

@@ -2,0 +7,0 @@ ------------------

2

lib/copy.js

@@ -0,1 +1,3 @@

"use strict"
var fs = require('fs')

@@ -2,0 +4,0 @@ , ncp = require('ncp').ncp;

20

lib/create.js

@@ -0,1 +1,3 @@

"use strict"
var mkdir = require('./mkdir')

@@ -8,2 +10,11 @@ , path = require('path')

function createFile (file, callback) {
function makeFile() {
fs.writeFile(file, '', function(err) {
if (err)
callback(err)
else
callback(null);
})
}
exists(file, function(fileExists) {

@@ -15,11 +26,2 @@ if (fileExists)

function makeFile() {
fs.writeFile(file, '', function(err) {
if (err)
callback(err)
else
callback(null);
})
}
exists(dir, function(dirExists) {

@@ -26,0 +28,0 @@ if (!dirExists) {

@@ -0,4 +1,7 @@

"use strict"
var fs = null
, path = require('path')
, jsonFile = require('jsonfile')
, json = require('./json')
, fse = {};

@@ -86,2 +89,7 @@

fs.outputJsonSync = json.outputJsonSync;
fs.outputJSONSync = json.outputJsonSync;
fs.outputJson = json.outputJson;
fs.outputJSON = json.outputJson;
fs.writeJsonFile = jsonFile.writeFile;

@@ -88,0 +96,0 @@ fs.writeJSONFile = jsonFile.writeFile;

@@ -0,1 +1,3 @@

"use strict"
var mkdirp = require('mkdirp');

@@ -2,0 +4,0 @@

@@ -0,1 +1,3 @@

"use strict"
var mkdir = require('./mkdir')

@@ -2,0 +4,0 @@ , path = require('path')

@@ -0,1 +1,3 @@

"use strict"
var rimraf = require('rimraf')

@@ -2,0 +4,0 @@ , fs = require('fs');

{
"name": "fs-extra",
"version": "0.6.0",
"version": "0.6.1",
"description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.",

@@ -5,0 +5,0 @@ "homepage": [

@@ -138,3 +138,3 @@

fs.outputFile(file, 'hello!' function(err) {
fs.outputFile(file, 'hello!', function(err) {
console.log(err); //null

@@ -149,2 +149,29 @@

### outputJson(file, data, callback)
Almost the same as `writeJson`, except that if the directory does not exist, it's created.
Alias: `outputJSON()
Sync: `outputJsonSync()`, `outputJSONSync()`
Example:
```javascript
var fs = require('fs-extra')
, file = '/tmp/this/path/does/not/exist/file.txt'
fs.outputJson(file, {name: 'JP'}, function(err) {
console.log(err); //null
fs.readJson(file, function(err, data) {
console.log(data.name); //'JP
})
})
```
### readJson(file, callback)

@@ -222,9 +249,9 @@

* File system walker. I really like this one: https://github.com/daaku/nodejs-walker
* File/directory tree watcher. There are quite a few.
* File system walker. I really like this one: https://github.com/daaku/nodejs-walker ... this might be adding too much.
* File/directory tree watcher. There are quite a few. ... this also might be adding too much.
* Method to move files.
* Copy sync.
* Thinking about moving `rimraf`, `ncp`, and `mkdirps` code into this library. I'd like fs-extra to be a stable library that module authors
can depend upon. A bunch of other dependencies kinda sucks for modules/libraries.
* Change documentation to use the `fse` prefix instead of `fs`. This may encourage people to start using `fse` as a prefix and hence make their code clearer that they're not using the native `fs`. I'm very undecided on this one since `fs-extra` is a drop in replacement for the native `fs`.
can depend upon. A bunch of other dependencies kinda sucks for modules/libraries. I'm leaning against this now.
* Change documentation to use the `fse` prefix instead of `fs`. This may encourage people to start using `fse` as a prefix and hence make their code clearer that they're not using the native `fs`. I'm very undecided on this one since `fs-extra` is a drop in replacement for the native `fs`. I'm leaning against this now.

@@ -231,0 +258,0 @@

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