superpath
About
superpath is a simple module to recrusive dissolve paths including environment varaibles like in a bash or bat script.
Installation
To install the package run:
$ npm install superpath
Usage
The following example shows how to use superpath
const superpath = ;/* You can also set the environment in the constructor. Default is the os your running the code. */const SuperPath = ; const env = "HOMEDRIVE": "C:" "USERHOME": "C:/Users/test"; let path = "%USERHOME%/program/foo.txt";path = SuperPath;//path = C:/Users/test/program/foo.txt now! /*To solve a path from the current process.env state use the dissolvefunction. Like in this example. */ path = "%USERHOME%/program/foo.txt";path = SuperPath;//path = C:/Users/test/program/foo.txt now!