1.0.16 • Published 10 months ago

path-string-prepend v1.0.16

Weekly downloads
4
License
MIT
Repository
github
Last release
10 months ago

path-string-prepend

Prepends a path to a platform-specfic delimited path string and removes duplicate paths.

var isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)
var DELIMITER = isWindows ? ';' : ':';

var prepend = once('path-string-prepend');
var assert = require('assert');

var envPath = ['other/path', 'another/path', 'install/path', 'other/path', 'another/path'].join(DELIMITER);
var pathsString = prepend(envPath, 'install/path');
assert(pathsString, ['install/path', 'other/path', 'another/path', 'other/path', 'another/path'].join(DELIMITER))
1.0.1

11 months ago

1.0.0

12 months ago

1.0.16

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

0.2.1

3 years ago

0.2.2

3 years ago

0.2.0

4 years ago

0.1.0

5 years ago