A tool and Node.js package to parse immanens' DLY container files.
These files are used by immanens' Delivery Reader.
The files start with the magic bytes DLY
and contain a header followed by a list of files.
Install the package globally:
npm install -g dly-parser
Then you can use the dly-parser
command:
dly-parser --help
View information about a DLY container:
dly-parser info path/to/container.dly
List files in a DLY container:
dly-parser list path/to/container.dly # List all files
dly-parser list path/to/container.dly --full # Show more information about each file
dly-parser list path/to/container.dly --extension pdf # Only files with the .pdf extension
dly-parser list path/to/container.dly --regex ".*\.(pdf|jpg)" # Only files with the .pdf or .jpg extension
Extract files from a DLY container:
dly-parser extract path/to/container.dly -o path/to/output/directory --all # Extract all files
dly-parser extract path/to/container.dly -o path/to/output/directory --extension pdf # Only extract files with the .pdf extension
dly-parser extract path/to/container.dly -o path/to/output/directory --regex ".*\.(pdf|jpg)" # Only extract files with the .pdf or .jpg extension
dly-parser extract path/to/container.dly -o path/to/output/directory --index 0,1,2 # Only extract files at the specified indices
dly-parser extract path/to/container.dly -o path/to/output/directory --index 0,1,2 --extension pdf # Only extract files that are at the specified indices or have the .pdf extension
dly-parser extract path/to/container.dly -o path/to/output/directory --index 0,1,2 --extension pdf --filter-all # Only extract files that are at the specified indices and have the .pdf extension
Install the package as a dependency:
npm install dly-parser
Then you can use the package in your code:
import { DLYContainer, DLYContainerProviderFS } from 'dly-parser';
const container = new DLYContainer(new DLYContainerProviderFS('path/to/container.dly'));
const header = await dly.parseHeader()
console.log(`Format-Version: ${header.archiveVersion & 0x0000FFFF}.${(header.archiveVersion & 0xFFFF0000) >> 16}`)
Have a look at the cli.ts file as an example.
Contributions are welcome! Feel free to open an issue or submit a pull request.