npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chord-charter

v1.6.1

Published

Application to convert chordpro files to HTML or PDF

Downloads

10

Readme

Charter

Turns .chordpro files into formatted HTML chord charts and renders them to PDF.

Turn something like this...

chordpro sample

...into something like this!

Chart sample

Requirements

To use this application, you will need Node.js version 12 or higher.

Setup

  1. Clone or download and unzip the source code.
  2. Open your terminal or command prompt and change to the source code folder.
  3. Install dependencies
npm install

Installing the Command-Line Interface (CLI)

The charter application can be installed as a command-line interface (CLI) app that can be used anywhere in your terminal or command prompt.

npm install -g .

This will install the chord-charter CLI app.

Usage

You can use this application to view .chordpro files as HTML in the browser and convert them to PDF. A sample ChordPro file is included in the source code.

Command Line Interface (CLI)

Converting a single ChordPro file to PDF. By default, the .pdf file will be saved in the same folder as the ChordPro file.

chord-charter -f path/to/chartfile.chordpro

Specifying the output file.

chord-charter -f path/to/chartfile.chordpro -o path/to/chordchart.pdf

Converting a folder of chordpro files at once. The folder will be scanned for any files ending with a .chordpro or .cho extension.

chord-charter -f path/to/chartfiles -o path/to/savepdfs

|Option|Description| |:---|:---| |--help|Show help| |--version|Show version number| |-f, --source|Path to file or folder of chordpro files to convert| |-o, --out|Path to destination file. If none specified, the file will be saved in the same path as the chordpro file.| |--temp|Specify path to the temp folder for generating intermediate files.| |--html|Save as HTML instead of PDF| |--columns|Use two-column format (doesn't work well with all charts)|

Advanced Usage

Converting ChordPro files to PDF

Put your .chordpro files in the charts folder and run in your terminal:

npm run start

HTML files will be generated in the build folder, and PDF files can be found in the pdf folder.

Viewing ChordPro files as HTML

Put your .chordpro files in the charts folder and run the following in your terminal.

npm run serve

In your browser, navigate to http://localhost:3000.

While running, any changes made to .chordpro files will be detected and the HTML is rebuilt. Refresh the browser page to see any changes.

Note: To stop the local web server, go to the terminal window and press CTRL+C.

Converting to PDF with wkHtmltoPDF

There is an option to use wkhtmltopdf to perform the final conversion from HTML to PDF. To us it, it must first be installed on your system and in your search path. For macOS, you can install this with Homebrew using the following.

Note: As of this writing, wkhtmltopdf does not support CSS columns, so a two-column chord chart format will not work.

brew cask install wkhtmltopdf

With wkHtmltoPDF installed, use the following npm command to convert all chord files in the charts folder and save them to the pdf folder.

npm run wk