
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
prepend-file
Advanced tools
Prepend data to a file, creating the file if it not yet exists.
$ npm install --save prepend-file
var prependFile = require('prepend-file');
prependFile('message.txt', 'data to prepend', function (err) {
if (err) {
// Error
}
// Success
console.log('The "data to prepend" was prepended to file!');
});
* filename String
* data String | Buffer
* options Object
encoding String | Null default = 'utf8'
mode Number default = 438 (aka 0666 in Octal)
* callback Function
Asynchronously prepend data to a file, creating the file if it not yet exists. The data
can be a string or a buffer.
The synchronous version of prependFile
. Returns undefined
.
MIT © Hemanth.HM
FAQs
Prepend data to a file, creating it if it doesn't exist.
We found that prepend-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.