@hexatool/fs-move
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-next.4 • Public • Published

Hexatool's fs-move module

Modular fs library.

Installation

npm install --save @hexatool/fs-move

Using yarn

yarn add @hexatool/fs-move

What it does

Moves a file or directory, even across devices.

API

move(src: string, dest: string, opts?: MoveOptions): void

  • src

    • Type: string.
    • Optional: false.
  • dest

    • Type: string.
    • Optional: false.
  • opts

    • Type: MoveOptions.
    • Optional: true.

MoveOptions

  • override. Overwrite existing file or directory
    • Type: boolean.
    • Optional: true.

Examples

import move from '@hexatool/fs-move';

move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile')

Using override option

import move from '@hexatool/fs-move';

move('/tmp/somedir', '/tmp/may/already/exist/somedir', { overwrite: true })

Async function

import move from '@hexatool/fs-move/async';

await move('/tmp/somedir', '/tmp/may/already/exist/somedir', { overwrite: true })

Hexatool Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

  • Respect Semantic Versioning: No breaking changes in patch or minor versions
  • No surprises in transitive dependencies: Use the bare minimum dependencies needed to meet the purpose
  • One specific purpose to meet without having to carry a bunch of unnecessary other utilities
  • Tests as documentation and usage examples
  • Well documented README showing how to install and use
  • License favoring Open Source and collaboration

Package Sidebar

Install

npm i @hexatool/fs-move

Weekly Downloads

0

Version

0.0.1-next.4

License

MIT

Unpacked Size

8.28 kB

Total Files

8

Last publish

Collaborators

  • mariomh