Socket
Socket
Sign inDemoInstall

extra-filesystem

Package Overview
Dependencies
32
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    extra-filesystem

```sh npm install --save extra-filesystem # or yarn add extra-filesystem ```


Version published
Weekly downloads
22
increased by83.33%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.5.1 (2023-06-10)

Bug Fixes

  • export src (1056b3c)

Readme

Source

extra-filesystem

Install

npm install --save extra-filesystem
# or
yarn add extra-filesystem

API

createTempDir

function createTempDir(): Promise<string>

createTempDirSync

function createTempDirSync(): string

createTempFile

function createTempFile(): Promise<string>

createTempFileSync

function createTempFileSync(): string

createTempName

function createTempName(): Promise<stirng>

createTempNameSync

function createTempNameSync(): string

emptyDir

function emptyDir(dirname: string): Promise<void>

emptyDirSync

function emptyDirSync(dirname: string): void

ensureDir

function ensureDir(dirname: string): Promise<void>

ensureDirSync

function ensureDirSync(dirname: string): void

ensureFile

function ensureFile(filename: string): Promise<void>

ensureFileSync

function ensureFileSync(filename: string): void

pathExists

function pathExists(path: string): Promise<boolean>

pathExistsSync

function pathExistsSync(path: string): boolean

readNDJSONFile

function readNDJSONFile<T>(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): AsyncIterableIterator<T>

readNDJSONFileSync

function readNDJSONFileSync<T>(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): IterableIterator<T>

readYAMLFile

function readYAMLFile<T>(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): Promise<T>

readYAMLFileSync

function readYAMLFileSync<T>(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): T

readJSONFile

function readJSONFile<T>(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): Promise<T>

readJSONFileSync

function readJSONFileSync<T>(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): T

writeJSONFile

function writeJSONFile(
  filename: string
, data: unknown
, options?: { spaces?: number }
): Promise<void>

writeJSONFileSync

function writeJSONFileSync(
  filename: string
, data: unknown
, options?: { spaces?: number }
): void

writeYAMLFile

function writeYAMLFile(filename: string, data: unknown): Promise<void>

writeYAMLFileSync

function writeYAMLFileSync(filename: string, data: unknown): void

move

function move(oldPath: string, newPath: string): Promise<void>

moveSync

function moveSync(oldPath: string, newPath: string): void

copy

function copy(sourcePath: string, destinationPath: string): Promise<void>

copySync

function copySync(sourcePath: string, destinationPath: string): void

remove

function remove(path: string): Promise<void>

removeSync

function removeSync(path: string): void

isDirectory

function isDirectory(path: string): Promise<boolean>

isFile

function isFile(path: string): Promise<boolean>

isWritable

function isWritable(path: string): Promise<boolean>

isReadable

function isReadable(path: string): Promise<boolean>

findAllFilenames

function findAllFilenames(
  dirname: string
, predicate: (dirname: string) => boolean = _ => true
): AsyncIterableIterator<string>

findAllDirnames

function findAllDirnames(
  dirname: string
, predicate: (dirname: string) => boolean = _ => true
): AsyncIterableIterator<string>

getLongExtension

function getLongExtension(filename: string): string

Get the longest possible extension.

getLongExtension('file.tar.gz') // '.tar.gz'

getShortBasename

function getShortBasename(filename: string): string

Get the shortest possible basename.

getShortBasename('file.tar.gz') // 'file'

readFileLineByLine

function readFileLineByLine(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): AsyncIterable<string>

readFileLineByLineSync

function* readFileLineByLineSync(
  filename: string
, encoding: BufferEncoding = 'utf-8'
): IterableIterator<string>

writeIterableToFile

function writeIterableToFile(
  filename: string
, iterable: Iterable<string> | AsyncIterable<string>
): Promise<void>

isSubPathOf

function isSubPathOf(subject: string, object: string): boolean

checksumFile

function checksumFile(algorithm: string, filename: string): Promise<string>

findUpPackageFilename

function findUpPackageFilename(pathname: string): Promise<string | undefined>

findUpPackageFilenameSync

function findUpPackageFilenameSync(pathname: string): string | undefined

FAQs

Last updated on 10 Jun 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc