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

objective-fs

v0.0.1

Published

Bash filesystem commands on JS objects

Downloads

2

Readme

Objective-Fs

Turns objects into filesystems so navigating through them is a breeze. This is useful for navigating through complex hierarchies.

But the module was mainly made as a joke. I'm not even sure why it exists.

var ofs = require('objective-fs')

var data = {
  x: {
    y: {
      z: "abc"
    }
 },

 DNA: ['ACT', 'GAT', 'CTT']

}

var filesystem = ofs(data)


/*
 * Give it a path
 */
filesystem.cat('/x/y/z') //--> 'abc'

/*
 * It works with array indices too!
 */
filesystem.cat('/DNA/0') //--> 'ACT'

var filesystem = ofs(object)

Wraps an object in an objective-fs instance.

filesystem.env([variable[,newValue]])

A miniature env for your objective filesystem. You can use this to cache key-value data. Calling env() with no arguments returns an object containing all environment variables. Calling env() with variable or both variable and newValue returns the environment variable for that key. variable: (String) the name of the environment variable you are requesting newValue: optionally set the variable for that key to a new value.

filesystem.cat(path)

Takes a string as an argument and returns the object(if it exists) for that path in the filesystem. The path follows Unix path conventions, with forward slashes to delimit directories, '.' to represent the current directory, '..' to represent the superdirectory and '/' to represent root.

filesystem.cd(path)

Virtually changes the current directory to path

filesystem.ls()

Returns the current object, as in the current directory, which can be changed with filesystem.cd

filesystem.touch()

Creates an object at the given path. Will replace the root object if specified, so be careful.

filesystem.cat(path)

Takes a path as an argument and returns the object located at that path.