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

songbeamer

v1.0.0

Published

Utility to parse songbeamer files into a javscript structure.

Downloads

13

Readme

Songbeamer parser

This little utility parses a songbeamer file into the following structure:

Structure

{
	props: {
		name: value,
		...
	}
	texts: { // Contains Verses as array
		verseName: [  //Verse: Contains slides as array
			[ //Slide: contains lines as array
				[ // Line: contains translations as string
					"Text ...",
					...
				]
				...
			]
			...
		]
	}
}

props

name and value are represeting key-value-pairs as in the upper section of the songbeamer file. The most properties are stored as strings matching the content of the sng file, but the following exceptions are handled different:

Title, TitleLang*

Will be stored in an Array under the name Title

"Title": [Title, TitleLang1, TitleLang2, ..., TitleLangN]

VerseOrder

Will be stored in an Array with a comma as seperator. If this is not defined in the file, it will be created and generated by the songtext. For this the first line of every verse is used and will be set as the name of the verse. If this is one of the Tags specified in songbeamer wiki, the line will be removed from songtext otherwise it is kept in the text.

Comments

Is stored in base64 encoding, this utility will decode it to normal string.

Chords

Is stored in base64 encoding, this utility will decode it to normal string. Afterwards it is splitted into an array (seperator is "\r")

Keywords

Is splitted into an array (seperator is " ")

Categories

Is splitted into an array (seperator is ",")

BackgroundImage

Will be returned the same as in the file, except the strings is a color ("color://$00000000"), then it will be saved as:

"BackgroundColor": {rgb: val}

"val" is the parsed hex color value ANDed with 0xFFFFFF and thereby represents an rgb value. The first byte of the songbeamer file color string has yet unknown functionality.

(c)

Is renamed to Copyright

Version, FontSize, Tempo, LangCount, ChurchSongID, CCLI

Values from theese keys will be parsed as integers.

texts

Is an associative array (object) of verses, how the key is determined is described in props:VerseOrder. Each verse is an array containing slides, each slide is also an array containing lines, each line is also an array containing different translations. The first translation is the main language (may be defined in props["Lang"]).

Usually in every line of a song there should be the same number of translations, but the last/only lines of a slide may contain less. This is either due to a malformed file or (if the line contains one translation) it could also mean that every language contains this last line. This behaviour was watched often in cases like "2x" or "(3x)", of course this make sense to be shown in every translation.

Links

  1. Official Songbeamer manual, is not really extensive
  2. Songbeamer file format descriptions