Registry / web-framework / songdown-compiler

songdown-compiler

JSON →
library0.7.0jsnpmunverified

A React component that compiles Songdown syntax (a markup language for chord sheets) into HTML for rendering. Version 0.7.0 is the latest stable release, with no further updates since 2015. It is part of the Songdown project, designed for musicians to write songs with chords, lyrics, guitar tabs, and comments. Key differentiators include transposing, font size control, and options to hide chords/comments/GOTOs. Requires React 0.13.x and lodash 3.x.x as peer dependencies. The project is unmaintained and uses outdated libraries, including React 0.13 (pre-hooks), lodash 3, and CoffeeScript heritage.

npm install songdown-compiler
INSTALL
IMPORT
SIG · SONGDOWN-COMPILER
S
songdown-compiler
web-frameworkjavascriptv0.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Song
var Song = require('songdown-compiler')(React);
Package is a function that takes React as an argument and returns a Song component. This pattern is required due to React 0.13 peer dependency.
Song
import React from 'react'; import createSong from 'songdown-compiler'; const Song = createSong(React);
import Song from 'songdown-compiler';
ESM import does not export the component directly; you must call the default export with React as an argument.
Song
var React = require('react'); var Song = require('songdown-compiler')(React);
var Song = require('songdown-compiler');
CommonJS require without calling the function will not return the component.

Shows how to require the library, create a Song component with props, and render it using React 0.13-style API.

var React = require('react'); var Song = require('songdown-compiler')(React); var song = React.createElement(Song, { chords: 'Am C G', lyrics: 'Verse 1\nAmazing grace how sweet the sound', transposition: 0, fontSize: 14, hideChords: false, hideComments: false, hideGotos: false }); React.render(song, document.getElementById('root'));
Debug
Known issues
deprecatedThe package requires React 0.13.x, which is heavily outdated and incompatible with modern React versions (16+).
fix
Migrate to a modern chord sheet rendering library like chord-sheet-renderer or react-chord-sheet.
affects: >=0.1.0
gotchaThe default export is a function that must be called with React as an argument; direct import does not work.
fix
Use var Song = require('songdown-compiler')(React);
affects: >=0.3.0
gotchaThe package uses lodash 3.x.x as a peer dependency, which is incompatible with lodash 4.x.x.
fix
Ensure lodash version 3.x is installed in your project.
affects: >=0.1.0
breakingVerse ending token changed in version 0.7.0, which may break existing Songdown documents.
fix
Update your Songdown files to use the new verse ending syntax as specified in the changelog.
affects: >=0.7.0
deprecatedReact.render() is used in the package, which was removed in React 0.14+. The package is incompatible with React 0.14+.
fix
Stick to React 0.13 or migrate to a different library.
affects: >=0.1.0
gotchaThe package relies on CoffeeScript compiled to JavaScript, making debugging harder.
fix
Use source maps or avoid this package for new projects.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: React.createClass is not a function
This package uses React 0.13's createClass, which was removed in React 16.
fix
Install React 0.13.x: npm install react@0.13 --save
Cannot find module 'lodash'
lodash 3.x is a peer dependency and not installed automatically.
fix
Install lodash 3.x: npm install lodash@3 --save
Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs.
Using this package with React >0.13 may cause incompatibility errors.
fix
Downgrade to React 0.13 or use an alternative library.
Warning: React.render is deprecated and will be removed in React 17
This package calls React.render, which was deprecated in React 0.14.
fix
Do not use this package with React 0.14+; if needed, use ReactDOM.render but may still break.
Upgrade
Version history
0.7.0latest on npm
Audit
Dependencies
lodashrequiredPeer dependency for utility functions
reactrequiredPeer dependency for rendering components
Agent activity
8 hits · last 30 days
node
6
Amazon
1
OpenAI (training)
1
Resources
songdown-compiler — npm install songdown-compiler · libregistry