
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
file-versioning
Advanced tools
As there is apparently no simple file versioning module in this repository, I will hereby contribute my very basic version for Node.js. To keep previous file versions, an already existing file will be assigned a unique consecutive version number.
npm install file-versioning
import FileVersioning from 'file-versioning'
const fv = FileVersioning()
async function saveVersion(filename, content) {
try {
await fv.writeFileVersion(filename, content)
}
catch (e) {
console.error(e)
}
}
await saveVersion('./files/file.txt', 'content of file')
// ...
await saveVersion('./files/file.txt', 'more recent content of file')
The example above will create files similar to this:
-rw-r--r-- 1 ..... ..... 15 May 5 21:00 file-v0.txt
-rw-r--r-- 1 ..... ..... 27 May 5 21:01 file.txt
fv.createFileVersion(filename)
If the file already exists, this method renames the existing file. A unique consecutive version number will be appended to this file.
fv.writeFileVersion(filename, content)
Writes the content to the specified file and keeps a previously existing file version. Internally calls the method 'fv.createFileVersion'.
FAQs
Simple file versioning
We found that file-versioning demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.