Gedi path functions

npm install gedi-paths
36 downloads in the last day
40 downloads in the last week
120 downloads in the last month

Gedi Paths

A convenience library for working with gedi paths.

browser support

var paths = require('gedi-paths');

// Create a valid gedi path from a string/number, or an array of strings/numbers.

// Checks if a path is absolute (basically, starts with '/'

// Checks if a path is equivilent to '[]'

paths.append(path1, path2, ... pathN);
// Adds paths together to form an unresolved path,
// eg, paths.append('[stuff]', '[/things]', '[../majigger]');
// would result in [stuff//things/../majigger], an unresolved, invalid path.

// Breaks a path into an array of path parts/keys.

// Returns a root path ('[/]')

paths.resolve(path1, path2, ... pathN);
// Resolves an invalid path to a valid one,
// eg: paths.resolve('[stuff//things/../majigger]')
// would result in '[/majigger]'
npm loves you