Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
install-files
Advanced tools
This module lets you share files between projects, e.g. configuration files.
install-files
lets you install files at the root directory of a project, whereas submodules can
only install files in subdirectories.
install-files
also merges files into existing directories, and lets you customize those directories
thereafter, whereas you'd have to fork a submodule to make custom modifications.
Lastly, install-files
lets you share files between Node projects the same way you would share code,
using npm
and declarative package names/versions.
Let's say you want to share some .ebextensions
files between several Node microservices. To do that with install-files
, you'd make a package with
those files, let's call it my-ebextensions
, with the following directory structure and package.json
:
my-ebextensions/
node_modules/
source/
.ebextensions/
foo.config
package.json
{
"name": "my-ebextensions",
"scripts": {
"install": "install-files source"
},
"dependencies": {
"install-files": "^1.0.0"
}
}
Then, when you install my-ebextensions
into my-microservice
, it will copy the contents of
my-ebextensions/source/
into my-microservice/
, where you can commit them as appropriate.
Before installing my-ebextensions
:
my-microservice/
node_modules/
index.js
package.json
After installing my-ebextensions
:
my-microservice/
.ebextensions/
foo.config
node_modules/
index.js
package.json
npm install install-files --save
You install install-files
into the package with the files to install, as per the example.
For a quick run-down, see the example. More details:
install-files source
will recursively merge source/
into the host package's directory
(my-microservice/
in the example), creating subdirectories if necessary. It will not replace
pre-existing files, including in subdirectories, unless source/
contains files with the same name.
For instance, if my-microservice/.ebextensions/
already contained bar.config
, install-files source
would not overwrite that. However, install-files source
would overwrite foo.config
.
This overwriting behavior lets the file-installing package interoperate with other, project-specific files, yet control its "own" files.
Modifications to the files should be made by updating the file-installing package, not by editing the copies.
Update the originals in the file-installing package, then push a new version of the package. When
npm update
is run in the dependent package, the changes will be copied over.
install-files
will not prune files that have been removed from source/
. If you feel that it
should and have ideas about how to do it, please open an issue!
We welcome pull requests! Please lint your code.
To run the Node tests: npm test
.
FAQs
This module lets you share files between projects, e.g. configuration files.
The npm package install-files receives a total of 195 weekly downloads. As such, install-files popularity was classified as not popular.
We found that install-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 21 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.