path-editor

0.1.0 • Public • Published

path-editor NPM version Build Status Dependency Status Coverage percentageStandard - JavaScript Style Guide

A windows path variable editor

Installation

$ npm install --save path-editor

Usage

var pathEditor = require('path-editor');
/**
 * Getting it
 */
var myPath = pathEditor.get() // => get your path variable parsed as an array
var myRawPath = pathEditor.getRaw() // => get your path variable as stored
 
/**
 * Basic usage
 */
pathEditor
    .delete('pathToRemove') // Could be an Array
    .add('pathToAdd')
    .replace('pathToRemove','pathToAdd')
    .set() // => this do the job. it put sets your %PATH% variable
    .get() //get what you did
/**
 * Forcing the path
 */
pathEditor
    .force('Dont-force-silly-things')
    .set()
/**
 * Using options
 */
pathEditor
    .add('.',{relative:true}) // Resolves the path relative where you use it
    .set()
 
pathEditor
    .add('this/is/not/a/windows/path',{format:true}) // Resolves the path as windows store it
    .set()

License

MIT © Fabian Gutierrez

Package Sidebar

Install

npm i path-editor

Weekly Downloads

4

Version

0.1.0

License

Apache-2.0

Last publish

Collaborators

  • fega