Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
bdat-versions-file
Advanced tools
This API parses, modifies, and serializes version history files for bdat archives. Used by https://github.com/pfraze/bdat and https://github.com/pfraze/beaker, with the dat network.
The file is a newline separated list, where each row takes the following form:
{semver} {change_num} {hex_hash}
// read and parse
var vfilePath = __dirname + '.bdat-versions'
var vfileData = require('fs').readFileSync(vfilePath, 'utf-8')
var vfile = require('bdat-versions-file').parse(vfileData)
// examine the log
console.log(vfile.versions) // => ['1.0.2', '1.0.1', '1.0.1']
console.log(vfile.current) // => '1.0.2'
console.log(vfile.log) /* => {
'1.0.2': { change: 54, hash: '...' },
'1.0.1': { change: 38, hash: '...' },
'1.0.0': { change: 12, hash: '...' }
}*/
// add a new version
vfile.append('2.0.0', newChangeNum, newHash)
// also supported:
// vfile.append('major', ...) - bump major
// vfile.append('minor', ...) - bump minor
// vfile.append('patch', ...) - bump patch
// vfile.append('prerelease', ...) - bump prerelease
// write to disk
var newVfileData = vfile.toString()
require('fs').writeFileSync(vfilePath, newVfileData, 'utf-8')
Parses the string-content of a file, and returns a vfile
object.
Returns an empty or partially-complete vfile if it finds parse errors.
Creates a new, empty vfile
object.
The vfile.current
value will be false.
Adds a new entry to the log.
version
may be a valid semantic version, or one of major
, minor
, patch
, prerelease
.
Throws if version
is invalid.
Serializes the vfile to a string.
Ordered list of all semvers in the file.
The current semver.
A map of the semvers to change numbers and hashes.
vfile.log['1.0.0'] // => { change: Number, hash: String }
FAQs
File containing the semver history of a dat archive.
The npm package bdat-versions-file receives a total of 1 weekly downloads. As such, bdat-versions-file popularity was classified as not popular.
We found that bdat-versions-file 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.