Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
dir-fs-utils
Advanced tools
Changelog
Readme
dir-fs-utils
is aiming to be a collection of the utility functions for directories build on top of the native fs
module.
npm i dir-fs-utils
Then anywhere in your code.
import { DirUtils } from 'dir-fs-utils`
or
const { DirUtils } = require('dir-fs-utils');
await DirUtils.getFolderSize(folder_path);
await DirUtils.listFolderContent(folder_path);
(1)
async listFolderContent(path: string): Promise<string[]> {}
This method will return an array with all the files in a folder.
If the provided path does not exist or is not accessible, then it will generate an error.
(2)
async getFolderSize(path: string): Promise<number> {}
This method will return the total size of a folder in bytes.
If the provided path does not exist or is not accessible, then it will generate an error.
(3)
async unwrap(folderPath: string, options?: UnwrapOptions): Promise<Map<string, string>>
export interface UnwrapOptions {
keepFolder?: boolean;
force?: boolean;
}
This method will open the contents of a folder. By default, it will remove the original folder and undo only files for which the destination path does not exist.
The returned value is a map that will contain all the files that failed to be unwrapped. If the size of the map is 0, then all the files were unwrapped successfully.
keepFolder?:boolean
- if this property is set to true, then the original folder will remain intact(files will not be deleted)force?:boolean
- if this property is set to true, then the destination of the unwrapped files will overwrittenPull requests and stars are always welcome. Please check the guidelines.
Author - Stan Georgian
This project is licensed under the MIT License
FAQs
A NodeJS library that creates several utility functions over the native fs module for directories
The npm package dir-fs-utils receives a total of 1,682 weekly downloads. As such, dir-fs-utils popularity was classified as popular.
We found that dir-fs-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.