Coder Social home page Coder Social logo

paradox.js's Introduction

Paradox.js

A library for reading paradox database files (*.db)

Usage

  var ParadoxTable = require("paradox.js")
  var fs = require("fs")
  
  var file = fs.readFileSync("path/to/file")
  var table = new ParadoxTable(file)

Getting records

You have to import the ParadoxTable and use .findRecords() method in order to get all records. This method also accepts an object which can contain the following properties: maxBlockNumber (an integer), filter (a function), disableWarning (a boolean).

  var records = table.findRecords({
    filter: function(record){
      if(someCriteria(record)){
        return true
      }
      return false
    }
  })

When the file size exceeds 100mb it will probably produce a memory error, so the use --max-old-space-size flag when running your script.

Creating a CSV file

  table.dumpToCSV()

The .dumpToCSV() method will create a output.csv file. This method also accepts a callback which will receive an array of records (a record is an array of Fields) in case you want to have more control over the output.

Notes

The following data types: Memo BLOb, Binary Large Object, Formatted Memo BLOb, OLE, Graphic BLOb, BCD and Bytes are currently not supported, so you will have to decode them yourself.

TODO

  1. Add support for more data types.
  2. If possible, improve perfomance and maybe do some refactoring.

There are some links below, as well as some documentation written by Randy Beck and Kevin Mitchell in /documents in case you want to contribute:

paradox.js's People

Contributors

dependabot[bot] avatar tomathosauce avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

orelinde jachzen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.