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 🙏

© 2024 – Pkg Stats / Ryan Hefner

superfs

v1.1.2

Published

Better file system support

Downloads

44

Readme

SuperFS

Build Status

Better filesystem support for Node.js

Dealing with files

const SuperFS = require('super-fs')
const fl = SuperFS.file('foo/bar.json')

// read a file content.then(file => {
  // Files is an array of files of `foo/`
});
const SuperFS = require('super-fs');
SuperFS.readDir('foo/').then(files => {
  // Files is an array of files of `foo/`
});

Read file

const SuperFS = require('super-fs');
SuperFS.readFile('foo/bar.js', 'FooBar').then(content => {
  // content is an buffer
});

// or

const fl = SuperFS.file('foo/bar.js');
await fl.write('FooBar');

Write file

const SuperFS = require('super-fs');
SuperFS.writeFile('foo/bar.js', 'FooBar').then(files => {
  // Files is an array of files of `foo/`
});

// or

const file = SuperFS.file('foo/bar.js');
await file.write('FooBar');

Copy dir

SuperFS.copyDir('foo/', 'bar/').then(files => {
  // Files is an array of files of `foo/`
});

Watch dir

const SuperFS = require('super-fs');
SuperFS.watch('foo/bar.js', handlerFn).then(files => {
  // Files is an array of files of `foo/`
});

// or

const file = SuperFS.file('foo/bar.js');
await file.watch(handlerFn);

file/dir exists

const SuperFS = require('super-fs');
await SuperFS.exists('foo/bar.js');

Options

ignore - Ignore files & dirs

The ignore flag is a pattern or an array of pattern. If any of the pattern matches a path, the item gets ignored.

* Matches anything exept a / ? matches any character once exept a / ** Matches any anything, including / [a-zA-Z] can be used to match a range of characters.

A pattern like *.js would match all .js files A pattern like test/**/*.js would match all .js files under test/ Patterns start matching from the root. test.js would match test.js but not a/test.js. Use */test.js or **/test.js instead.

Filepattern format

The slash / is used as the directory separator. Separators may occur at the beginning, middle or end of the .gitignore search pattern.

If there is a separator at the beginning or middle (or both) of the pattern, then the pattern is relative to the directory level of the particular .gitignore file itself. Otherwise the pattern may also match at any level below the .gitignore level.

If there is a separator at the end of the pattern then the pattern will only match directories, otherwise the pattern can match both files and directories.

For example, a pattern doc/frotz/ matches doc/frotz directory, but not a/doc/frotz directory; however frotz/ matches frotz and a/frotz that is a directory (all paths are relative from the .gitignore file).

An asterisk "*" matches anything except a slash. The character "?" matches any one character except "/". The range notation, e.g. [a-zA-Z], can be used to match one of the characters in a range. See fnmatch(3) and the FNM_PATHNAME flag for a more detailed description.

Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning:

A leading "**" followed by a slash means match in all directories. For example, "**/foo" matches file or directory "foo" anywhere, the same as pattern "foo". "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo".

A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.

A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.

Other consecutive asterisks are considered regular asterisks and will match according to the previous rules.