## Installation
-:warning: This package should be installed as an optional dependency until static macOS builds are available from [`dhall-haskell` releases](https://github.com/dhall-lang/dhall-haskell/releases).
-
There’s two installation modes:
### Locked
```
-npm install --save-optional fretlink/node-dhall-json-bin#v<dhall-json version>-<dhall version>-<package version>
+npm install fretlink/node-dhall-json-bin#v<dhall-json version>-<dhall version>-<package version>
```
This will install a specific version of `dhall-json`. Replace `<dhall-json version>`, `<dhall version>` and `<package version>` with appropriate versions of `dhall-json`, `dhall` and this package.
### Dynamic
```
-npm install --save-optional fretlink/node-dhall-json-bin
+npm install fretlink/node-dhall-json-bin
```
This will install a version of `dhall-json` matching the `DHALL_JSON_VERSION` and `DHALL_VERSION` environment variables or the `dhall-json:dhall-json-version` and `dhall-json:dhall-version` [npm configuration settings](https://docs.npmjs.com/misc/config#per-package-config-settings).
"version": "1.0.1",
"description": "NPM package for `dhall-json`, based on https://github.com/justinwoo/npm-psc-package-bin-simple.",
"os": [
+ "darwin",
"linux",
"win32"
],
res.pipe(unzipper.Extract({ path: bindir }))
);
} else {
- get("x86_64-linux.tar.bz2", res =>
+ const isDarwin = process.platform === 'darwin';
+
+ if (isDarwin && isLowerThan(dhallJsonVersion, "1.4.0")) {
+ throw new Error(`Static macOS binaries aren’t provided by \`dhall-json@<1.4.0\`.`);
+ }
+
+ get(`x86_64-${isDarwin ? 'macos' : 'linux'}.tar.bz2`, res =>
res.pipe(unbz2()).pipe(tar.x({ C: __dirname }).on("finish", () => {
fs.readdir(bindir, (err, names) => {
if (err) throw err;