Socket
Socket
Sign inDemoInstall

curried-paths

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    curried-paths

Let's you create functions for paths that behave like path.join


Version published
Maintainers
1
Install size
1.35 MB
Created

Readme

Source

node-curried-paths

This lets you create functions that behave similarly to path.join(), rooted at specified directories. You can then create new functions, recursively, for subdirectories.

For example:

var curriedPath = require('curried-paths');
var process = require('process');

// Curried path for the current working directory
var work = curriedPath(process.cwd());
work();               //=>  string representation of cwd
work('sub');          //=>  `cwd`/sub
work('sub', 'sub');   //=>  `cwd`/sub/sub
work('..', '..');     //=>  grandparent of `cwd`

// Create a new function for a subdirectory
var test = work.sub('test');
test();                  //=> `cwd`/test
test('sub1', 'sub2');    //=> `cwd`/test/sub1/sub2

Keywords

FAQs

Last updated on 25 Apr 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc