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

@jeefo/fs

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jeefo/fs - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

50

index.js
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
* File Name : index.js
* Created at : 2019-09-24
* Updated at : 2020-10-27
* Updated at : 2021-02-20
* Author : jeefo

@@ -13,3 +13,3 @@ * Purpose :

/* globals*/
/* globals -open, -close*/
/* exported*/

@@ -28,8 +28,26 @@

const {
stat,
symlink,
open,
read,
close,
unlink,
readFile,
writeFile,
mkdir,
rmdir,
readdir,
} = fs;
my_fs.symlink = (target, path, type) => promise_wrapper((resolve, reject) => {
symlink(target, path, type, err => err ? reject(err) : resolve());
});
my_fs.stat = filepath => promise_wrapper((resolve, reject) => {
fs.stat(filepath, (err, stats) => err ? reject(err) : resolve(stats));
stat(filepath, (err, stats) => err ? reject(err) : resolve(stats));
});
my_fs.unlink = filepath => promise_wrapper((resolve, reject) => {
fs.unlink(filepath, err => {
unlink(filepath, err => {
if (err) err.code === "ENOENT" ? resolve() : reject(err);

@@ -41,3 +59,3 @@ else resolve();

my_fs.open = (filepath, flags, mode) => promise_wrapper((resolve, reject) => {
fs.open(filepath, flags, mode, (err, file_handler) => {
open(filepath, flags, mode, (err, file_handler) => {
return err ? reject(err) : resolve(file_handler);

@@ -49,3 +67,3 @@ });

return promise_wrapper((resolve, reject) => {
fs.read(fd, buffer, offset, length, position, (err, bytes_read) => {
read(fd, buffer, offset, length, position, (err, bytes_read) => {
return err ? reject(err) : resolve(bytes_read);

@@ -57,7 +75,7 @@ });

my_fs.close = fd => promise_wrapper((resolve, reject) => {
fs.close(fd, err => err ? reject(err) : resolve());
close(fd, err => err ? reject(err) : resolve());
});
my_fs.readFile = (fp, options = {}) => promise_wrapper((resolve, reject) => {
fs.readFile(
readFile(
fp, options, (err, data) => err ? reject(err) : resolve(data)

@@ -69,5 +87,3 @@ );

(resolve, reject) => {
fs.writeFile(
fp, data, options, err => err ? reject(err) : resolve()
);
writeFile(fp, data, options, err => err ? reject(err) : resolve());
}

@@ -103,3 +119,3 @@ );

const exists_factory = method => fp => promise_wrapper((resolve, reject) => {
fs.stat(fp, (err, stats) => {
stat(fp, (err, stats) => {
if (err) err.code === "ENOENT" ? resolve(false) : reject(err);

@@ -122,3 +138,3 @@ else resolve(method ? stats[method]() : true);

my_fs.readdir = dirpath => promise_wrapper((resolve, reject) => {
fs.readdir(dirpath, (err, files) => err ? reject(err) : resolve(files));
readdir(dirpath, (err, files) => err ? reject(err) : resolve(files));
});

@@ -146,7 +162,7 @@

my_fs.mkdir = (dirpath, options = {}) => promise_wrapper((resolve, reject) => {
fs.mkdir(dirpath, options, err => err ? reject(err) : resolve());
mkdir(dirpath, options, err => err ? reject(err) : resolve());
});
my_fs.rmdir = dirpath => promise_wrapper((resolve, reject) => {
fs.rmdir(dirpath, err => err ? reject(err) : resolve());
rmdir(dirpath, err => err ? reject(err) : resolve());
});

@@ -174,4 +190,4 @@

my_fs.remove = filepath => promise_wrapper((resolve, reject) => {
fs.stat(filepath, async (err, stats) => {
if (err) return err.code === "ENOENT" ? resolve() : reject(err);
stat(filepath, async (err, stats) => {
if (err) err.code === "ENOENT" ? resolve() : reject(err);
try {

@@ -178,0 +194,0 @@ if (stats.isDirectory()) {

{
"name": "@jeefo/fs",
"version": "0.0.9",
"version": "0.0.10",
"homepage": "https://github.com/je3f0o/fs",

@@ -5,0 +5,0 @@ "copyright": "2020",

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