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

h3lp

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h3lp - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

1

infrastructure/fs.d.ts

@@ -11,2 +11,3 @@ /// <reference types="node" />

remove(sourcePath: string): Promise<void>;
removeDir(directoryPath: string): Promise<void>;
copy(src: string, dest: string): Promise<void>;

@@ -13,0 +14,0 @@ write(sourcePath: string, content: string): Promise<void>;

28

infrastructure/fs.js

@@ -52,8 +52,2 @@ "use strict";

}
// public async mkdir (sourcePath:string):Promise<void> {
// const fullPath = this.resolve(sourcePath)
// return new Promise<void>((resolve, reject) => {
// fs.mkdir(fullPath, { recursive: true }, err => err ? reject(err) : resolve())
// })
// }
resolve(source) {

@@ -91,2 +85,24 @@ const _source = source.trim();

}
removeDir(directoryPath) {
return __awaiter(this, void 0, void 0, function* () {
try {
const stats = yield this.lstat(directoryPath);
if (!stats.isDirectory()) {
yield this.remove(directoryPath);
return;
}
const files = yield this.readdir(directoryPath);
yield Promise.all(files.map((file) => __awaiter(this, void 0, void 0, function* () {
const filePath = path_1.default.join(directoryPath, file);
yield this.removeDir(filePath);
})));
return new Promise((resolve, reject) => {
fs_1.default.rmdir(directoryPath, err => err ? reject(err) : resolve());
});
}
catch (err) {
console.error(`Error removing directory ${directoryPath}: ${err}`);
}
});
}
copy(src, dest) {

@@ -93,0 +109,0 @@ return __awaiter(this, void 0, void 0, function* () {

{
"name": "h3lp",
"version": "1.7.0",
"version": "1.8.0",
"description": "Helper for nodeJs",

@@ -5,0 +5,0 @@ "author": "Flavio Lionel Rita <flaviolrita@hotmail.com>",

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