Skip to content

MauriceButler/caroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

caroot

Replaces a caret with the root path (closest package.json)

Usage

caroot(caretedPath, currentPath[, rootSubDirectory])

var caroot = require('caroot');

// assume we are 2 levels deeper than package.json

caroot('^foo', __dirname);

// returns '../../foo'


// also takes an optional root sub directory

caroot('^foo', __dirname, './scripts');

// returns '../foo'

About

Replaces a caret with the root path

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published