Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fsu

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fsu - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

index.js

@@ -111,3 +111,3 @@ 'use strict';

openUnique(filename, options, (err, fd) => {
openUnique(filename, options, (err, fd, newPath) => {
if (err) {

@@ -117,3 +117,3 @@ cb(err);

let buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, options.encoding || 'utf8');
writeAll(fd, buffer, 0, buffer.length, 0, cb);
writeAll(fd, buffer, 0, buffer.length, 0, (...args) => cb.apply(null, args.concat(newPath)));
}

@@ -120,0 +120,0 @@ });

@@ -27,3 +27,3 @@ {

},
"version": "1.0.0"
"version": "1.0.1"
}

@@ -13,5 +13,5 @@ # fsu (fs unique)

```js
var fsu = require('fsu');
const fsu = require('fsu');
fsu.openUnique("text{_###}.txt", (err, fd) => {
fsu.openUnique("text{_###}.txt", (err, fd, path) => {
//now we can use file descriptor as usual

@@ -25,6 +25,6 @@ });

```js
var fsu = require('fsu');
const fsu = require('fsu');
fsu.writeFileUnique("text{_###}.txt", "test", err => {
console.log("Done");
fsu.writeFileUnique("text{_###}.txt", "test", (err, path) => {
console.log("Done", path);
});

@@ -37,6 +37,9 @@ ```

```js
var fsu = require('fsu');
var stream = fsu.createWriteStreamUnique("text{_###}.txt");
const fsu = require('fsu');
let stream = fsu.createWriteStreamUnique("text{_###}.txt");
```
## new path
Stream has a `path` property that contains a new path
## force path creation

@@ -43,0 +46,0 @@ Add `force = true` to options, and it will recursively create directories if they are not exist.

@@ -7,5 +7,4 @@ 'use strict';

fsu.writeFileUnique('test/test{_file###}.txt', 'test', { force: true }, err => {
fsu.writeFileUnique('test/test{_file###}.txt', 'test', { force: true }, (err, path) => {
if (err) {
console.log(err);
} else {

@@ -12,0 +11,0 @@ fs.createReadStream('readme.md').pipe(stream);

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