mscabinet

```javascript import { Extract, CFFile } from 'cabinet'; import * as path from 'path'; import * as fs from 'fs';

Usage no npm install needed!

<script type="module">
  import mscabinet from 'https://cdn.skypack.dev/mscabinet';
</script>

README

node-mscabinet

Example

import { Extract, CFFile } from 'cabinet';
import * as path from 'path';
import * as fs from 'fs';

const extract = new Extract();
const dist = './dist';
fs.createReadStream('input.cab').pipe(extract)
    .on('entry', (file: CFFile, stream, next) => {
        const target = path.resolve(dist, '.' + file.name);
        const dirname = path.dirname(target);
        fs.mkdirSync(dirname, {recursive: true});
        stream
            .on('finish', () => next())
            .pipe(fs.createWriteStream(target));
    })
    .on('close', () => {
        console.log("ONCLOSE");
    });