1.0.4 • Published 3 years ago

nicefs v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

nicefs is a Node library whose goal is to provide a clean path & filesystem API. It's designed after Go's filepath and os packages.

To install: Build and test npm

yarn add nicefs

And to use, just import FS and Path:

import {FS, Path} from "nicefs"

async function main() {
    Path.extension(fname) // Returns: ".jpg"

    // Splits path into dir & file:
    let {dir, file} = Path.splitDirFile("/home/user/readme.txt")
    
    // Returns "/home/user"
    let home = Path.homeDir();

    await FS.removeAll("/my/dir") // Deletes /my/dir
    await FS.readDir("/my/dir")   // Returns: ["a.txt", "b.txt"]

    // reading as binary and utf8
    await FS.readFile("my.file")
    await FS.readFile("my.file2", "utf8")
}

💡 API & examples

Available at https://fikisipi.github.io/nicefs/

Features

  • TypeScript and TypeDoc documentation available
  • Supports both esm and commonjs bundling
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago