cabrillo

0.1.0 • Public • Published

Cabrillo.js


npm npm downloads

  • Now support CQWW series,CQWPX series,NAQP and Standard template log
  • works in a browser, on a server

Introduction


Cabrillo.js is a JavaScript library that converts cabrillo contest files and json to each other.

Installation


Currently only npm installation is supported

npm install cabrillo --save

Usage


Convert JSON objects into cabrillo's standard format string

objectToCabrillo(json,option)

Example:

var cabrillo = require('cabrillo')
var fs = require('fs') // if in Node.js
var data = fs.readFileSync('contest.json')
 
var option = {
    contest:'NAQP'
}
 
fs.writeFile("contest.txt", cabrilloCore.objectToCabrillo(data,option), err =>{
    if(err) throw err;
    console.log("Success!");
} )
 

Convert a cabrillo string to a json object

cabrilloToObject(String,option)

Example:

var cabrillo = require('cabrillo')
var fs = require('fs') // if in Node.js
var data = fs.readFileSync('contest.txt')
 
var option = {
    contest:'NAQP'
}
 
fs.writeFile('contest.json', JSON.stringify(cabrilloCore.cabrilloToObject(data,option), null, 4), err => {
    if(err) throw err;
    console.log("Success!");
});

Example


The sample file example.js is stored in the example folder.

git clone https://github.com/YuYanDev/cabrillo.js
cd cabrillo.js
npm run example

License


Apache 2.0

Created by YuYan ( DE BG6TTI - K6TTI )

Readme

Keywords

Package Sidebar

Install

npm i cabrillo

Weekly Downloads

0

Version

0.1.0

License

Apache-2.0

Unpacked Size

45 kB

Total Files

11

Last publish

Collaborators

  • sakarahiroya