
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
npm i files-js
import { file_exists, ls_dir, mkdir, write_file, read_file } from 'files-js';
/*
returns true if the file exists
@param {String} path
*/
file_exists(path)
/*
@param {String} path
*/
file_not_exists(path)
/*
list all files from a directory path
this function returns a list of all values from a directory
@param String path
*/
ls_dir(path)
/*
list directories
this function returns a list of directories within the passed directory
@param String path
*/
ls_dirs(path)
/*
list all files in a directory
this function returns a list of files within the passed directory
@param String path
*/
ls_files(path)
/*
this is a humble function that makes a directory that is passed
If the directories recursively
@param {string} path to directory
relative paths are from the current working dir
ex:./data/mined/companies
*/
mkdir(path)
/*
this is a humble function that makes a file and writes a string on it
@param {string} path to directory
@param {string} string to be written
*/
write_file(path, string = '')
/*
reads a text from a file and returns as a string
@param {string} path to directory
*/
read_file(path)
/*
remove a file
@param {String} from_path
@param {String} to_path
*/
mv(from_path, to_path)
/*
remove a file
@param {String} path
*/
rm_file(pat)
/*
remove a directory, with options, can be passed
@param {String} path
@obj {
recursive: true
force: true
} options
*/
rm_dir(path, options)
/*
@param {} obj
@param {} path
*/
write_json(obj, path)
/*
@param {} path
*/
read_json(path)
/*
@param {} path
*/
delete_json(path)
/*
this function reads a binary file from the disk
return a binary buffer obj
@param {} path
*/
read_binary(path)
/*
this function writes down a binary file to disk
from a binary buff
@param {} buff
@param {} path
*/
write_binary(buff, path)
/*
this function writes down a binary string to disk
@param {} bin_string
@param {} path
*/
write_binstr(bin_str, path)
FAQs
This is my personal library for handling files in nodejs
We found that files-js 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.