Socket
Socket
Sign inDemoInstall

chordsheetjs-extras

Package Overview
Dependencies
7
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chordsheetjs-extras

A JavaScript library of extras for ChordSheetJS


Version published
Maintainers
1
Install size
5.05 MB
Created

Readme

Source

ChordSheetJS-Extras

A JavaScript library of extras for ChordSheetJS

Based in part on code from ChordSheetJS by Martijn Versluis.

Contents

Installation

ChordSheetJS-Extras is on npm, to install run:

npm install chordsheetjs-extras

Make sure to install ChordSheetJS; it is a peer dependency. Extras can be used without it... but we don't know why you would.

npm install chordsheetjs

Load with import:

import ChordSheetJS from 'chordsheetjs';
import ChordSheetJSExtras from 'chordsheetjs-extras';

or require():

var ChordSheetJS = require('chordsheetjs').default;
var ChordSheetJSExtras = require('chordsheetjs-extras');

How to ...?

Display a parsed sheet

HTML format
Table-based layout, extended!
const chordSheet = `
{title: Let it be}
{subtitle: ChordSheetJS example version}
{artist: John Lennon, Paul McCartney}
{key: C}
{tempo: 80}
{time: 4/4}
{Chorus}

Let it [Am]be, let it [C/G]be, let it [F]be, let it [C]be
[C]Whisper words of [G]wisdom, let it [F]be [C/E] [Dm] [C]`.substring(1);

const parser = new ChordSheetJS.ChordProParser();
const song = parser.parse(chordSheet);
const formatter = new ChordSheetJSExtras.HtmlTableExtFormatter();
const disp = formatter.format(song);

API docs

Note: all classes, methods and constants that are documented here can be considered public API and will only be subject to breaking changes between major versions.

HtmlTableExtFormatter

Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like PDF conversion.

Kind: global class

htmlTableExtFormatter.format(song) ⇒ string

Formats a song into HTML.

Kind: instance method of HtmlTableExtFormatter
Returns: string - The HTML string

ParamTypeDescription
songSongThe song to be formatted

FAQs

Last updated on 10 Aug 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc