anchor.diff:          # The other responsibilities of NPM are kept -- version checks, build
           # steps, postprocessing etc.
           
  +        export HOME=$TMPDIR
           cd ${name}
  -        export HOME=$TMPDIR
  +        npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
           npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
           
           # Create symlink to the deployed executable folder, if applicable
  
positive.code: {stdenv, python, nodejs, utillinux, runCommand}:
  
  let
    # Function that generates a TGZ file from a NPM project
  
negative.code:     });
  
    # Builds a development shell
    buildNodeShell = { name, version, src, dependencies ? [], production ? true, npmFlags ? "", ... }@args:
      let
        nodeDependencies = stdenv.mkDerivation {
          name = "node-dependencies-${name}-${version}";
          
          buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
          
          includeScript = includeDependencies { inherit dependencies; };
          passAsFile = [ "includeScript" ];
          
          buildCommand = ''
            mkdir -p $out/lib
            cd $out/lib
            source $includeScriptPath
            
            # Create fake package.json to make the npm commands work properly
            cat > package.json <<EOF
            {
                "name": "${name}",
                "version": "${version}"
            }
            EOF
            
            npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
            npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
          '';
        };
      in
      stdenv.mkDerivation {
        name = "node-shell-${name}-${version}";
        
        buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
        buildCommand = "true";
        
        # Provide the dependencies in a development shell through the NODE_PATH environment variable
  