@qsp/converters
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

QSP file format converters

Converters of different file formats for QSP platform http://qsp.org/

Installation

npm install --save @qsp/converters

Usage

This library has separate functions for reading and writing file formats. QSP primary format is binary, but there exists also commonly agreed text format. Library references these 2 formats as qsp for binary and qsps for text format. File reading/writing was deliberately not made a part of library so it can easily be used in any environment (browser or Node.js) that supports ArrayBuffer and typed arrays. Text format is expecting utf8 encoded string so if you have string in different encoding you need to convert it before using library.

Reading

function readQsp(buffer: ArrayBuffer): QspLocation[];
function readQsps(content: string): QspLocation[];

Writing

function function writeQsp(locations: QspLocation[]): ArrayBuffer;
function function writeQsps(locations: QspLocation[], linebreak?: string): string;

writeQsps uses \n as line-break by default but this can be configured using second argument.

Licensing

The code in this project is licensed under MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @qsp/converters

Weekly Downloads

35

Version

1.0.1

License

MIT

Unpacked Size

98.7 kB

Total Files

22

Last publish

Collaborators

  • srg-kostyrko