
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
A Node.js package for handling files and folders in a directory.
Use npm to install the package:
npm install flexfile
Import the package in your Node.js project:
const flexFile = require('flexfile');
Recursively retrieves all files and subfiles in a directory.
fileUtils.getFilesAndSubfiles({
path: '/path/to/directory',
allowedExtensions: ['js', 'txt'], // Optional. Specify the allowed file extensions. Default is ['js'].
avoidFiles: ['example.js'] // Optional. Specify files to avoid. Default is an empty array.
})
.then(files => {
console.log(files);
})
.catch(error => {
console.error(error);
});
Retrieves both files and folders in a directory.
fileUtils.getFilesAndFolders({
path: '/path/to/directory',
allowedExtensions: ['js', 'txt'], // Optional. Specify the allowed file extensions. Default is ['js'].
avoidFiles: ['example.js'], // Optional. Specify files to avoid. Default is an empty array.
})
.then(result => {
console.log('Folders:', result.folders);
console.log('Files:', result.files);
})
.catch(error => {
console.error(error);
});
Retrieves only files in a directory.
fileUtils.getFiles({
path: '/path/to/directory',
allowedExtensions: ['js', 'txt'], // Optional. Specify the allowed file extensions. Default is ['js'].
avoidFiles: ['example.js'], // Optional. Specify files to avoid. Default is an empty array.
})
.then(files => {
console.log(files);
})
.catch(error => {
console.error(error);
});
Retrieves only folders in a directory.
fileUtils.getFolders({
path: '/path/to/directory',
avoidFolder: ['node_modules'] // Optional. Specify folders to avoid. Default is an empty array.
})
.then(folders => {
console.log(folders);
})
.catch(error => {
console.error(error);
});
Recursively retrieves all folders and subfolders in a directory.
fileUtils.getFoldersAndSubfolders({
path: '/path/to/directory',
avoidFolders: ['node_modules'] // Optional. Specify folders to avoid. Default is an empty array.
})
.then(folders => {
console.log(folders);
})
.catch(error => {
console.error(error);
});
This project is licensed under the MIT License.
FAQs
Flexfile is a simple file management system for Node.js
We found that flexfile 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.