npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@srhenry/storage-manager

v1.4.12

Published

A Custom filesystem wrapper for Node.JS implemented in Typescript.

Readme

Storage Manager

Storage Manager module to wrap Node.js filesystem access with ease. This module is Promise-ready, all methods return promises or stream objects. Both Javascript (CommonJS) and Typescript (ES6+) are supported.

GitHub GitLab

Npm package version Npm package total downloads Npm package license

Table of Contents

Installing

npm install @srhenry/storage-manager --save

or from git repository:

git clone [email protected]:SrHenry/storage-manager.git
cd storage-manager
npm run build

Docs

Some examples

/**
 * Basic file manipulation
 */

import { StorageManager } from "@srhenry/storage-manager"

// Get content from file as string
let content = await StorageManager.get("path/to/file")

// Write content to file
await StorageManager.put("path/to/file", "Hello World!")

// Append content to file
await StorageManager.append("path/to/file", "Tail here :)")

// Check if file or directory exists:
if (await StorageManager.exists("path/to/file")) {
    // Do something if file exists
} else {
    // Do something if file doesn't exist
}

// Create directory (if not exist):
await StorageManager.mkdir("new/path")

// Delete file
await StorageManager.delete("path/to/file")

// Get stream object of a file
let stream = StorageManager.fileStream("path/to/file")

// Fetching directory list from path (no recursion)
let dirs = await StorageManager.listDirectory("path")

/*
    Fetching directory list from path (with recursion).
    It returns a DirectoryList representing given path,
    which is iterable (for..of, spread operator),
    and it contains strings for inner files and another DirectoryList instance for each inner directory.
    You can see directory name in DirectoryList with `name` property accessor.
*/
let dirs_deep = await StorageManager.listDirectory("path", true)

// copying files or directories:
await StorageManager.copy("path/to/file", "new/path")
// copying files or directories (w/ renaming):
await StorageManager.copy("path/to/file", "new/path", "new_name")

// renaming files or directories
await StorageManager.rename("path/to/file", "new_name")

// moving files or directories
await StorageManager.move("path/to/file", "new/path")
// moving files or directories (w/ renaming)
await StorageManager.move("path/to/file", "new/path", "new_name")

// fetching file or directory metadata
// @see https://nodejs.org/api/fs.html#fs_class_fs_stats for further documentation on those metadata
const metadata = await Storage.stats("path/to/file")

let isFile = metadata.isFile() // Returns true if is a file
let isDirectory = metadata.isDirectory() // Returns true if is a directory

// shortand for check if given path is a file
isFile = await StorageManager.isFile("path/to/file")
// shortand for check if given path is a directory
isDirectory = await StorageManager.isDirectory("path/to/file")