Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

linkfs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkfs

Rewrites filesystem paths

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
77K
decreased by-39.27%
Maintainers
1
Weekly downloads
 
Created
Source

linkfs

Redirects filesystem paths.

npm install --save linkfs
import {link} from 'linkfs';
import {fs} from 'memfs';

fs.writeFileSync('/foo', 'bar');
const lfs = link(fs, ['/foo2', '/foo']);
console.log(lfs.readFileSync('/foo2', 'utf8')); // bar

Reference

link(fs, rewrites)

Returns a new fs-like object with redirected file paths.

fs is the source fs-like object.

rewrites is a 2-tuple or an array of 2-tuples, where each 2-tuple has a form of [from, to]. from is the new, virtual path; and to is an existing path in the fs filesystem.

const lfs = link(fs, ['/foo', '/bar']);

or

const lfs = link(fs, [
    ['/foo1', '/bar1'],
    ['/foo2', '/bar2'],
    ['/foo3', '/bar3'],
]);

License

Unlicense - public domain.

Keywords

FAQs

Package last updated on 29 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc