🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@jiaminghi/fs

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jiaminghi/fs

Promise fs based on node.js fs

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
2
Created
Source

ENGLISH

FS

LICENSE LICENSE

使用 Promise 封装了一些常用的文件系统方法(基于 Node.js 的 fs 文件系统)

npm 安装

$ npm install @jiaminghi/fs

使用

import { readFile } from '@jiaminghi/fs'

// do something

示例

stat

type stat = (
  path: fs.PathLike,
  options: fs.StatOptions = { bigint: false }
) => Promise<fs.Stats | fs.BigIntStats | false>

mkDir

type mkDir = (path: fs.PathLike, options: fs.MakeDirectoryOptions = {}) => Promise<boolean>

access

type access = (path: fs.PathLike, mode = fs.constants.F_OK) => Promise<boolean>

copyDir

type copyDir = (path: fs.PathLike, dest: string) => Promise<boolean>

readDir

type readDir = (path: fs.PathLike) => Promise<string[] | false>

clearDir

type clearDir = (path: fs.PathLike) => Promise<boolean>

emptyDir

type emptyDir = (path: fs.PathLike) => Promise<boolean>

readFile

type readFile = (
  path: fs.PathLike,
  options: { encoding: string; flag?: string } = { encoding: 'utf8' }
) => Promise<string | false>

writeFile

type writeFile = (
  path: fs.PathLike,
  data: any,
  option: fs.WriteFileOptions = 'utf8'
) => Promise<boolean>

dirForEach

type dirForEach = (path: fs.PathLike, callback: (path: string) => any) => Promise<boolean>

fileForEach

type fileForEach = (path: fs.PathLike, callback: (path: string) => any) => Promise<boolean>

unlinkDirFileByExtname

type unlinkDirFileByExtname = (path: fs.PathLike, extnames: string[] = []) => Promise<boolean>

Keywords

fs

FAQs

Package last updated on 06 Jul 2020

Did you know?

Socket

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.

Install

Related posts