Module: node2nix

Contains utility functions that generate Nix expressions from NPM package specifications
Source:

Methods

(static) copyNodeEnvExpr(nodeEnvNix, callback)

Writes a copy of node-env.nix to a specified path.
Parameters:
Name Type Description
nodeEnvNix String Path to which the NPM package build expression is written
callback function Callback function that gets invoked if the operation is done. If an error has occured, the error parameter is set to the error message.
Source:

(static) npmToNix(inputJSON, outputNix, compositionNix, nodeEnvNix, supplementJSON, supplementNix, production, includePeerDependencies, flatten, nodePackage, registries, noCopyNodeEnv, bypassCache, useFetchGitPrivate, stripOptionalDependencies, callback)

Generates a Nix expression from a JSON file representing a Node.js package configuration or an array of NPM dependencies.
Parameters:
Name Type Description
inputJSON String Path to a package.json or arbitrary JSON file
outputNix String Path to which the generated registry expression is written
compositionNix String Path to which the generated composition expression is written
nodeEnvNix String Path to which the NPM package build expression is written
supplementJSON String Path to a supplement JSON file
supplementNix String Path to which the generated supplement expression is written
production Boolean Indicates whether to deploy the package in production mode
includePeerDependencies Boolean Indicates whether to include peer dependencies with the package
flatten Boolean Indicates whether to create a flat dependency structure in which dependencies are as high as possible in the graph
nodePackage String Name of the Node.js package to use from Nixpkgs
registries Array.<Registry> URL and AuthToken
noCopyNodeEnv Boolean Indicates that no copy of the NPM package build expression should be made
bypassCache Boolean Indicates that the content addressable cache should be bypassed
useFetchGitPrivate Boolean Indicates that the fetchgitPrivate function should be used instead of fetchgit
stripOptionalDependencies Boolean When enabled, the optional dependencies are stripped from the regular dependencies in the NPM registry
callback function Callback function that gets invoked when the work is done. If an error occurs, the error parameter is set to contain the error If the operation succeeds, it returns a string containing the registry expression containing the packages and all its dependencies
Source: