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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cu-mkp/editioncrafter-cli

v1.2.0

Published

This is the command line tool to take a TEI XML file and turn it into a IIIF Manifest and the necessary Web Annotations to display the text in EditionCrafter.

Downloads

217

Readme

editioncrafter-cli

This is the command line tool to take a TEI XML file and turn it into a IIIF Manifest and the necessary Web Annotations to display the text in EditionCrafter.

Installing

Node

EditionCrafter CLI requires Node. To check if Node is installed, open your terminal or command line and type:

node --version

If the output is a number, you already have Node installed. If the output is an error like "Command not found", you need to install Node.

Please note that EditionCrafter CLI supports Node 14 and higher. If your version of Node is below 14, you'll need to upgrade.

To install or upgrade Node, visit https://nodejs.org/en/download and follow the instructions for your operating system. Alternatively, if you're using the Windows Subsystem for Linux, you should upgrade the version of Linux you're running to one that comes with a newer version of Node.

Installing EditionCrafter

To install the latest version, run:

npm install -g @cu-mkp/editioncrafter-cli

The editioncrafter command will now be available. If it doesn't work right away, try restarting your terminal program.

Usage

The following commands are available to the EditionCrafter CLI.

help

Usage:

editioncrafter help

This will display information on the syntax for passing commands to the CLI as well as a list of available commands.

iiif

Usage:

editioncrafter iiif -i <iiif_url> -o <output_path>

This will create an XML file at the location of the provided <output_path> based on the information in the IIIF manifest supplied. Note that in this case the <output_path> should be a single XML File, e.g. /MyFiles/TEI/index.xml.

images

Usage:

editioncrafter images -i <csv path> -o <output file>

This will create an XML file at the location of the provided <output_path> based on the image data in the CSV file supplied. Note that in this case the <output_path> should be a single XML File, e.g. /MyFiles/TEI/index.xml.

The CSV file should be in the following format:

url,label,xml_id
"https://mywebsite/foo.jpg","My first page","f000"
"https://mywebsite/foo2.jpg","My second page","f001"

process

Usage:

editioncrafter process -i <tei_file> -o <output_path> -u <base_url>

This will create all of the artifacts that EditionCrafter needs in order to display your document on the web, and place them in the specified <output_path> folder. The <base_url> parameter should be the URL at which you intend to host these artifacts.

database

Process the TEI document into a SQLite file containing a directory of categories and tags. This can be used with the Record List component from the EditionCrafter viewer package, or it can be browsed directly with a SQLite viewer.

Usage: editioncrafter database [-i tei_file] [-o output_path]

Required parameters:

  • -i tei_file
  • -o output_path (must end in .sqlite)

Command line options

-c or --config

Example usage: editioncrafter process -c ./myconfig.json

You may optionally pass the path of a configuration file as -c config_path rather than passing individual parameters. The optional configuration file is a JSON file with the following options:

{
    "inputPath": "myfile.xml",
    "outputPath": ".",
    "baseUrl": "http://localhost:8080",
}

-t or --text

Example usage: editioncrafter iiif -i https://example.com/manifest.json -o ./example.xml -t ./my-text-files

The -t parameter allows you to pass a folder of plain text files to the images or iiif scripts. The text files will be inserted into the XML file generated by the script.

This option generates facs IDs based on each file's name. For example, a file named f000.txt will be transformed into a <pb facs="#f000"> element followed by the text content of the file. Each block of text will be wrapped in an <ab> element. Line breaks are preserved with <lb /> tags.

Generates the following files:

tei_document_id/tei/index.xml tei_document_id/tei/resource_id/index.xml tei_document_id/tei/resource_id/surface_id/index.xml

tei_document_id/iiif/manifest.json

tei_document_id/html/index.html tei_document_id/html/resource_id/index.html tei_document_id/html/resource_id/surface_id/index.html

Running a development build

The first time you run this program, you'll need to install its dependencies with npm install.

Within the root folder, run npm link to make the repo available as a global command. The entry point is configured by the bin property in package.json.

Open a new terminal session and type which editioncrafter to verify that it linked correctly.