https://github.com/aleclarson/tar-install
Install a package from a .tgz url
https://github.com/aleclarson/tar-install
Last synced: 23 days ago
JSON representation
Install a package from a .tgz url
- Host: GitHub
- URL: https://github.com/aleclarson/tar-install
- Owner: aleclarson
- License: mit
- Created: 2018-04-05T12:18:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-03-23T16:03:38.000Z (over 5 years ago)
- Last Synced: 2026-05-14T16:28:54.467Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tar-install
```js
const install = require('tar-install')
// Any .tgz url works
const url = 'https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz'
// Pass which directory to install into
await install(url, '/path/to/parent')
```
Per the example above, `lodash` would be installed at `/path/to/parent/lodash-4.17.5`.
The `install` promise resolves with the destination path.
The root directory is created if it doesn't exist, and it defaults to the working directory.
You can use https://github.com/aleclarson/tar-url to obtain the url.
Run `node test ` to try it out. The package is installed in the `test`
directory. Both `name` and `version` are optional. The default is latest version of
`lodash`.