# objective-fs

> Bash filesystem commands on JS objects

Latest version **0.0.1** (published 2016-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install objective-fs
pnpm add objective-fs
yarn add objective-fs
bun add objective-fs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-01-22 |
| First published | 2016-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Akiva Lipshitz |
| Maintainers | theideasmith |
| Keywords | build, object, builder, chain |

## Links

- npm: https://www.npmjs.com/package/objective-fs
- Repository: https://github.com/theideasmith/objective-fs
- Homepage: https://github.com/theideasmith/objective-fs#readme
- Issues: https://github.com/theideasmith/objective-fs/issues
- npm.io page: https://npm.io/package/objective-fs

## Dependencies (2)

- [minimatch](https://npm.io/package/minimatch.md) ^2.0.10
- [pretty-path](https://npm.io/package/pretty-path.md) file:../pretty-path

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2016-01-22

## 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. 

```javascript
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.

---
_Source: https://npm.io/package/objective-fs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
