Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
file-ensure
Advanced tools
Simply ensure that a file exists, else create it: this becomes handy
when you provide skeleton file, like config_dev.yml.example
that should
be ignored in git but need to be available in your FS to run your
application.
As usual, this module is provided through NPM:
npm install file-ensure
The module's usage is straightforward:
ensure(filePath, options, [callback])
# or
ensure(filePath, [callback])
Simply require and use it for every file you want to make sure that exists in your filesystem:
var ensure = require('file-ensure');
ensure('path/to/config_dev.yml');
Simple as that :)
You can also create the file from another file:
ensure('path/to/config_dev.yml', {from: 'path/to/config_dev.yml.example'}, function(err){
console.log(fs.readFileSync('path/to/config_dev.yml').toString() === fs.readFileSync('path/to/config_dev.yml.example').toString());
});
This small library is tested through mocha, while automated tests run on travis.
FAQs
Ensures that a file exists: if not, it creates it.
The npm package file-ensure receives a total of 0 weekly downloads. As such, file-ensure popularity was classified as not popular.
We found that file-ensure demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.