Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@jiaminghi/fs
Advanced tools
读取文件状态
创建文件夹
连接文件
复制文件夹到指定位置,若文件夹已存在将被清空后进行复制操作
读取文件夹
递归清空文件夹,若文件夹不存在将被创建
递归清空文件夹
读取文件
写入文件
遍历文件夹
递归遍历文件
递归删除指定 extname 的文件
$ npm install @jiaminghi/fs
import { readFile } from '@jiaminghi/fs'
// do something
type stat = (
path: fs.PathLike,
options: fs.StatOptions = { bigint: false }
) => Promise<fs.Stats | fs.BigIntStats | false>
type mkDir = (path: fs.PathLike, options: fs.MakeDirectoryOptions = {}) => Promise<boolean>
type access = (path: fs.PathLike, mode = fs.constants.F_OK) => Promise<boolean>
type copyDir = (path: fs.PathLike, dest: string) => Promise<boolean>
type readDir = (path: fs.PathLike) => Promise<string[] | false>
type clearDir = (path: fs.PathLike) => Promise<boolean>
type emptyDir = (path: fs.PathLike) => Promise<boolean>
type readFile = (
path: fs.PathLike,
options: { encoding: string; flag?: string } = { encoding: 'utf8' }
) => Promise<string | false>
type writeFile = (
path: fs.PathLike,
data: any,
option: fs.WriteFileOptions = 'utf8'
) => Promise<boolean>
type dirForEach = (path: fs.PathLike, callback: (path: string) => any) => Promise<boolean>
type fileForEach = (path: fs.PathLike, callback: (path: string) => any) => Promise<boolean>
type unlinkDirFileByExtname = (path: fs.PathLike, extnames: string[] = []) => Promise<boolean>
FAQs
Promise fs based on node.js fs
We found that @jiaminghi/fs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.