Skip to content

Borewit/file-type-cfbf

Repository files navigation

NPM version Node.js CI npm downloads

@file-type/cfbf

Detector plugin for file-type that identifies files based on the Compound File Binary Format, commonly known as CFBF or OLE Compound Document.

CFBF is a container format used by many legacy Microsoft Office files and other Windows applications. This plugin detects the container itself, not the specific document content inside it.

Installation

npm install @file-type/cfbf

Usage

The following example shows how add the CFBF detector to file-type.

import {FileTypeParser} from 'file-type';
import {detectCfbf} from '@file-type/cfbf';

const parser = new FileTypeParser({customDetectors: [detectCfbf]});
const fileType = await parser.fromFile('smaple.doc');
console.log(fileType);

Support file formats

This detector identifies files that use the Compound File Binary Format Format container:

Microsoft Office legacy formats

These are pre-Office Open XML binary Office formats (CFBF/OLE), used by Microsoft Office prior to Office 2007:

  • .doc Microsoft Word documents (Word 6.0/95, Word 97–2003)
  • .pub Microsoft Publisher documents (Publisher 3.0/95-4.0/97, Publisher 5.0/98)
  • .ppt Microsoft PowerPoint presentations (PowerPoint 4.0, 7.0/95, 97–2003)
  • .vsd Microsoft Visio drawings (2000–2002, 2003–2010)
  • .wps Microsoft Works 7–9 Word Processor Document
  • .xls Microsoft Excel spreadsheets (Excel 5.0/95, Excel 97–2003)

Other files:

Licence

This project is licensed under the MIT License. Feel free to use, modify, and distribute as needed.

About

Compound File Binary Format (CFBF) detection plugin for file-type

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 3

  •  
  •  
  •