Skip to content

backuprepos/removeNPMAbsolutePaths

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

removeNPMAbsolutePaths

removeNPMAbsolutePaths is a small utility to remove the fields that npm adds to the modules in node_modules containing local aboslute paths.

It has been noted that the package.json of modules in the node_modules folder contain some extra fields lie _args and where which contain the absolute path of the module. According to NPM those fields are not even used.

The problem comes when you are planning to package your application using electron, NW.js or similar and distribute it. You might not one to distribute files containing absolutes path within your computer.

A feature request has been raised to NPM to fix this issue.

Using removeNPMAbsolutePaths

removeNPMAbsolutePaths simple loop through all the files in the given folder, open the files called package.json an remove all the fields stating with an underscore (_).

You can install removeNPMAbsolutePaths globally and use it from the command line

npm install -g removeNPMAbsolutePaths
removeNPMAbsolutePaths "<PROJECT_FOLDER>"

or use it from whithin your code

var removeNPMAbsolutePaths = require('mkLib');
removeNPMAbsolutePaths("<PROJECT_FOLDER>");

Version

0.0.1

License

MIT

About

Remove the fields containing local aboslute paths created by NPM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%