1.0.3 • Published 4 years ago
@crispengari/fsmove v1.0.3
@crispengari/fsmove
This package is build on top of the native fs package in node.js. It brings the interface of moving files or folders from one path to the other.
Installation
- yarn
yarn add @crispengari/fsmove- npm
npm install @crispengari/fsmoveUsage
To use this package is very simple. All you need to do is to provide the path for the source and the path of the destination to the move function to move files or folders.
Examples
es6typescript example
import { move } from "@crispengari/fsmove";
const source: string = "/path/source/filename.ext";
const destination: string = "/path/destination/filename.ext";
const moveFile = async () => {
console.log(await move(source, destination)); // returns true on success
};
moveFile();es6javascript example
import { move } from "@crispengari/fsmove";
const source = "/path/source/filename.ext";
const destination = "/path/destination/filename.ext";
const moveFile = async () => {
console.log(await move(source, destination)); // returns true on success
};
moveFile();es5javascript example.
const { move } = require("@crispengari/fsmove");
const source = "/path/source/filename.ext";
const destination = "/path/destination/filename.ext";
async function moveFile() {
console.log(await move(source, destination)); // returns true on success
}
moveFile();Why this simple package?
I created this package, so that i can reuse it whenever i want to deal with moving files and folders around in node.js. I created this package because i wanted to use it on my toy project fmanager to move files and folders from one folder to another.