mifjs
v1.0.0
Published
Lightweight Node.js library for Movie Information Format (.mif) archives
Maintainers
Readme
MIFjs
mifjs is a lightweight Node.js library for the Movie Information Format (.mif), a ZIP-based container format for movie metadata, subtitles, actor appearance timelines, and associated assets.
Features
- Load and save
.mifarchives usingjszip - Validate required package files and formats
- Parse
manifest.ini,meta.ini,appearances.json, andsubtitles.srt - Add content assets under
content/ - CLI support:
inspect,extract, andcreate
Package structure
A valid .mif archive contains:
manifest.inimeta.inisubtitles.srtappearances.jsoncontent/(optional)
Installation
Install dependencies with npm or yarn:
npm installUsage
const { MIFPackage } = require('mifjs');
const pkg = MIFPackage.create({
meta: { title: 'The Matrix', year: 1999, runtime_ms: 8160000 },
subtitles: '1\n00:00:00,000 --> 00:00:02,000\nWake up, Neo.\n',
appearances: {
actors: {
keanu_reeves: { name: 'Keanu Reeves', image: 'content/keanu.png' }
},
appearances: [ { actor: 'keanu_reeves', start_ms: 1000, end_ms: 10000 } ]
}
});
pkg.addContentFile('keanu.png', Buffer.from('<raw-image-bytes>'));
await pkg.save('movie.mif');CLI
npx mifjs/bin/mifpy.js inspect movie.mif
npx mifjs/bin/mifpy.js extract movie.mif ./out
npx mifjs/bin/mifpy.js create sample.mifTesting
No unit tests are included in this scaffold. Run the create command and inspect the result:
npm run start -- create sample.mif