https://github.com/parro-it/libui-download
Downloads a libui release zip from github
https://github.com/parro-it/libui-download
Last synced: about 1 year ago
JSON representation
Downloads a libui release zip from github
- Host: GitHub
- URL: https://github.com/parro-it/libui-download
- Owner: parro-it
- License: mit
- Created: 2016-06-18T16:45:32.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-04-30T07:53:02.000Z (about 8 years ago)
- Last Synced: 2024-09-24T01:58:59.522Z (over 1 year ago)
- Language: JavaScript
- Size: 188 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# libui-download
[](https://travis-ci.org/parro-it/libui-download)
[](https://nodei.co/npm/libui-download/)
downloads a libui release zip from github
used by [libui-node](https://npmjs.org/libui-node)
### usage
```plain
$ npm install --global libui-download
$ libui-download --version=0.31.1
```
```js
var download = require('libui-download');
const zipPath = await download({
version: '0.25.1',
arch: 'ia32',
platform: 'win32',
cache: './zips' // defaults to /.libui
});
// zipPath will be the path of the zip that it downloaded.
// if the zip was already cached it will skip
// downloading and call the cb with the cached zip path
// if it wasn't cached it will download the zip and save
// it in the cache path
```
if you don't specify `arch` or `platform` args it will use `require('os')` to get them from the current OS. specifying `version` is mandatory.
If you would like to override the mirror location, three options are available. The mirror URL is composed as `url = LIBUI_MIRROR + LIBUI_CUSTOM_DIR + '/' + LIBUI_CUSTOM_FILENAME`.
You can set the `LIBUI_MIRROR` or [`NPM_CONFIG_LIBUI_MIRROR`](https://docs.npmjs.com/misc/config#environment-variables) env or `mirror` opt variable to use a custom base URL for grabbing libui zips. The same pattern applies to `LIBUI_CUSTOM_DIR` and `LIBUI_CUSTOM_FILENAME`
```plain
## for a local mirror
LIBUI_MIRROR="https://10.1.2.105/"
LIBUI_CUSTOM_DIR="our/internal/filePath"
```
# Attribution
This is based on [electron-download](https://github.com/electron-userland/electron-download)
by @maxogden @mafintosh and @fritx. Thank you!
# License
The MIT License (MIT)
Copyright (c) 2016 parro-it