Package Exports
- cdxj
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cdxj) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-cdxj
Currently this project only supports reading cdxj files but with more reading, witting, and searching modes planed in the future.
Example usage
const readCDXJ = require('cdxj')
async function getMeSomeCDXJ () {
let cdxj = await readCDXJ('<path-to-cdxj-file>')
cdxj.forEach(cdxjEntry => {
console.log(`The URL in surt form for this entry is: ${cdxjEntry.surt}`)
console.log(`The raw datetime for this entry is: ${cdxjEntry.dt}`)
console.log(`The json data for this entry is: ${cdxjEntry.json}`)
})
}
API
readCDXJ([path-to-cdxj-file])
Returns a Promise that resolves with an array of CDXJEntrys or rejects if an error occurred
CDXJEntry
Properties
surt: returns the CDXJEntries URL key in surt formdt: returns the raw (string) datetime associated with the CDXJEntryjson: returns the parsed JSON data associated with the CDXJEntry
The properties are lazily transformed to their appropriate values the first time the getter for a property is called. Internally they are kept as a raw Buffer