Registry / serialization / dbf-parser

dbf-parser

JSON →
library0.0.1jsnpmunverified

An event-based, pure JavaScript parser for reading data from dBase (.dbf) files. Based on node-dbf but adds float type support, correct handling of numeric fields, and works without CoffeeScript. Version 0.0.1 is stable but minimal: only Character and Numeric field types are supported. Primarily for Node.js, uses EventEmitter for streaming output. Not actively maintained; alternative libraries like dbf or shapefile-js may offer more complete implementations.

npm install dbf-parser
INSTALL
IMPORT
SIG · DBF-PARSER
D
dbf-parser
serializationjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Parser
const Parser = require('dbf-parser');
import Parser from 'dbf-parser';
Package is CJS-only; no ESM exports.

Shows how to create a parser, register event handlers, and start parsing a .dbf file.

const Parser = require('dbf-parser'); const parser = new Parser('/path/to/file.dbf'); parser.on('start', () => console.log('Parsing started')); parser.on('header', (header) => console.log(header)); parser.on('record', (record) => console.log(record)); parser.on('end', () => console.log('Parsing complete')); parser.parse();
Debug
Known issues
gotchaOnly Character and Numeric field types are supported; other types (e.g., Date, Logical) may cause parse errors or undefined behavior.
fix
Pre-process .dbf file to ensure only supported types, or use a more full-featured library like dbf.
affects: 0.0.1
gotchaThe module is not actively maintained; last updated years ago. Known issues with large files and unsupported field types.
fix
Consider alternatives like shapefile-js or dbf for ongoing support and features.
affects: 0.0.1
gotchaUses synchronous fs.readFile internally, so large .dbf files may block the event loop. Documentation mentions intended switch to fs.readStream but not implemented.
fix
For large files, use a streaming parser like dbf (npm package) or chunk the file manually.
affects: 0.0.1
gotchaRecord field values are trimmed of padding characters, which may remove legitimate leading/trailing spaces.
fix
If field padding is significant, use a different parser that preserves raw content.
affects: 0.0.1
Errors
Common errors & fixes
Error: Unsupported field type: D
Date field type (type code 'D') is not supported.
fix
Remove or convert Date fields to Character or Numeric before processing.
TypeError: parser.on is not a function
Forgot to call new Parser() and use require correctly.
fix
Ensure you use 'const parser = new Parser(path);' after requiring the module.
Cannot find module 'dbf-parser'
Module not installed or path is incorrect.
fix
Run 'npm install dbf-parser' in your project directory.
RangeError: File size exceeds maximum buffer
Large file being read entirely into memory via fs.readFile.
fix
Use a streaming parser like 'dbf' (npm package) for files over 1GB.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
dbf-parser — npm install dbf-parser · libregistry