Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chesstournament-ctx-support

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chesstournament-ctx-support

Plugin for chesstournament.js to create exports in the Chess Tournament Exchange (CTX) format.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

chesstournament.js-CTX-support

Plugin for chesstournament.js to create exports in the Chess Tournament Exchange (CTX) format.

Usage with chesstournament.js

Currently this module provides only an export plugin. An import plugin is intended.

Export plugin

All you have to do is register this module as an export plugin in your chesstournament.js instance:

var Tournament = require('chesstournament');
Tournament.to.use(require('chesstournament-CTX-support'));

Then CTX files can be created by simply call

Tournament.from('/path/to/your.SWT', function handleTournament(err, tnmt) {
  // do what you want
});

Programmatic Usage

It's also possible to use this module to simply convert information chunks given as an object which swtparser returned:

// convert a single Player
var convertPlayer = require('chesstournament-SWT-support/lib/import/player');
var playerJSON = {
	2000: 'Falco Nogatz',
	2008: '1990      '
};
var player = convertPlayer(playerJSON);
console.log(player instanceof Tournament.Player);

// convert multiple Players
var convertPlayers = require('chesstournament-SWT-support/lib/import/players');
var players = [playerJSON]; // result.players of swtparser result
var playersList = convertPlayers(players);
console.log(playersList instanceof Tournament.PlayersList);

// for more convert functions see files in lib/import

TODO

  • Create import function from CTX

Keywords

FAQs

Package last updated on 20 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc