can options be added to npm package.json dependencies? can options be added to npm package.json dependencies? sqlite sqlite

can options be added to npm package.json dependencies?


An alternative is to use the scripts member and setup the install script under the preinstall or postinstall hook:

"scripts": {  "preinstall": "npm install --build-from-source --sqlite=/path/to/sqlite sqlite3"},


You can set below two environment variables which will work as passing options with npm install:

export npm_config_build-from-source=trueexport npm_config_sqlite=/path/to/sqlite"dependencies": {    "sqlite3": "*" }

Above combination will install sqlite3 as npm install --build-from-source --sqlite=/path/to/sqlite sqlite3. Thanks.