1.0.16 • Published 5 months ago

path-string-prepend v1.0.16

Weekly downloads
4
License
MIT
Repository
github
Last release
5 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

5 months ago

1.0.0

7 months ago

1.0.16

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 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