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

node-fs

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-fs - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

.travis.yml

34

lib/fs.js

@@ -10,7 +10,7 @@ (function () {

/**
* Offers functionality similar to mkdir -p
*
* Asynchronous operation. No arguments other than a possible exception
* are given to the completion callback.
*/
* Offers functionality similar to mkdir -p
*
* Asynchronous operation. No arguments other than a possible exception
* are given to the completion callback.
*/
function mkdir_p (path, mode, callback, position) {

@@ -32,3 +32,3 @@ var parts = require('path').normalize(path).split(osSep);

mkdirOrig(directory, mode, function (err) {
if (err && err.errno != 17) {
if (err && err.code != 'EEXIST') {
return callback(err);

@@ -62,3 +62,3 @@ } else {

} catch (e) {
if (e.errno != 17) {
if (e.code != 'EEXIST') {
throw e;

@@ -72,7 +72,7 @@ }

/**
* Polymorphic approach to fs.mkdir()
*
* If the third parameter is boolean and true assume that
* caller wants recursive operation.
*/
* Polymorphic approach to fs.mkdir()
*
* If the third parameter is boolean and true assume that
* caller wants recursive operation.
*/
fs.mkdir = function (path, mode, recursive, callback) {

@@ -96,7 +96,7 @@ if (typeof recursive !== 'boolean') {

/**
* Polymorphic approach to fs.mkdirSync()
*
* If the third parameter is boolean and true assume that
* caller wants recursive operation.
*/
* Polymorphic approach to fs.mkdirSync()
*
* If the third parameter is boolean and true assume that
* caller wants recursive operation.
*/
fs.mkdirSync = function (path, mode, recursive) {

@@ -103,0 +103,0 @@ if (typeof recursive !== 'boolean') {

{
"name": "node-fs",
"description": "node-fs is an extension to the original nodejs fs library, offering new functionalities.",
"version": "0.1.4",
"version": "0.1.5",
"author": "Bruno Pedro <bpedro@tarpipe.com>",

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

@@ -6,2 +6,4 @@ node-fs is an extension to the original [nodejs](http://nodejs.org) [fs library](http://nodejs.org/docs/v0.3.1/api/fs.html), offering new functionalities. See example.js for an example of how to use it.

* mkdir(path, mode, [recursive], [callback]): if the 'recursive' parameter is true, creates a directory recursively;
* mkdirSync(path, mode, [recursive]): if the 'recursive' parameter is true, synchronously creates a directory recursively.
* mkdirSync(path, mode, [recursive]): if the 'recursive' parameter is true, synchronously creates a directory recursively.
[![Build Status](https://secure.travis-ci.org/bpedro/node-fs.png?branch=master)](http://travis-ci.org/bpedro/node-fs)
var fs = require('../lib/fs');
var assert = require('assert');
// Define the base temporary directory where tests will be written
var tmpBaseDir = '/tmp/_node-fs-test';
/**

@@ -8,3 +11,3 @@ * Tests the recursive creation of a directory

exports.testRecursiveMkdir = function() {
fs.mkdir('/tmp/example_dir/first/second/third/fourth/fifth', 0777, true, function (err) {
fs.mkdir(tmpBaseDir + '/a/b/c/d/e', 0777, true, function (err) {
assert.isUndefined(err);

@@ -14,8 +17,11 @@ });

exports.testRecursiveSyncMkdir = function() {
try {
fs.mkdirSync('/tmp/example_sync/first/second/third/fourth/fifth', 0777, true);
} catch (e) {
console.log(e);
}
/**
* Tests the synchronous creation of a directory
*/
exports.testRecursiveMkdirSync = function() {
assert.doesNotThrow(
function () {
fs.mkdirSync(tmpBaseDir + '/_sync/a/b/c/d/e', 0777, true);
}
);
}
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