dbf

0.2.0 • Public • Published

dbf

Build Status


Looking for new maintainers!

This project is currently unmaintained. We'd love to turn it over to a new maintainer. If you're interested, please file an issue!


Write dBase files in pure JavaScript, in node.js or browsers. Requires ArrayBuffer and DataView support.

usage

npm install dbf

Or just in a browser:

https://unpkg.com/dbf@latest/dbf.js

Replace latest with the latest version if you want to be sure.

example

in node:

var dbf = require('../'),
    fs = require('fs');

var buf = dbf.structure([
    {foo:'bar',noo:10},
    {foo:'louie'}
]);

fs.writeFileSync('foo.dbf', toBuffer(buf.buffer));

function toBuffer(ab) {
    var buffer = new Buffer(ab.byteLength);
    var view = new Uint8Array(ab);
    for (var i = 0; i < buffer.length; ++i) {
        buffer[i] = view[i];
    }
    return buffer;
}

API

dbf.structure(array)

Given an array of objects with string or number attributes, return a DataView object referencing an ArrayBuffer that contains a full DBF file structure.

Specifications

Package Sidebar

Install

npm i dbf

Weekly Downloads

6,079

Version

0.2.0

License

BSD-2-Clause

Unpacked Size

15.8 kB

Total Files

10

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user