1.0.9 • Published 9 months ago

@benthaminstruments/ben-to-json v1.0.9

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
9 months ago

BenWin+ .ben binary file to JSON converter

Node CI Publish package on release

ben-to-json

Read spectrum files produced by Bentham's BenWin+ Software in Javascript

Install

  • npm install @bentham-instruments/ben-to-json

Examples

Using require

const { parse } = require('@benthaminstruments/ben-to-json');

const fs = require('fs');

const ben_file_data = fs.readFileSync('spectra.ben');
let json = parse(ben_file_data);

console.log(json);

Using import

import { parse } from '@benthaminstruments/ben-to-json';

import {readFileSync} from 'fs';

const ben_file_data = readFileSync('spectra.ben');
let json = parse(ben_file_data);

console.log(json);

Full-ICU (Pre Node v13)

If you are using an old version of node, pre v13, then it needs to be run with in a special way as these older versions were not built with full international support by default.

This support can be added by using the NODE_ICU_DATA to point to an installed version of the full-icu package. e.g. "cross-env NODE_ICU_DATA=./node_modules/full-icu node script.js