Skip to content

YuYanDev/cabrillo.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 )

About

cabrillo Ham radio log conversion lib

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published