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

phraseapp-json-cli

v0.3.0

Published

Update translations from PhraseApp

Readme

phraseapp-json-cli

This CLI provides commands for common tasks when working with translation strings using a nested JSON format.

The idea is that you have a single JSON file checked into source control, and you use the CLI to keep it (or parts of it) in sync with PhraseApp.

Installation

npm install --global phraseapp-json-cli

Usage

pa <command> [options] [<args>]

Available commands

All commands will require you to specify PhraseApp-related options like --project-id or --access-token. This is great for trying out the CLI, but specifying everything inline gets tedious very quickly. For your convenience, these options can be also specified as environment variables, which can be stored in .env file.

These environment variables correspond to CLI options, except that they are in SCREAMING_SNAKE_CASE and prefixed with PHRASEAPP. Eg. --project-id becomes PHRASEAPP_PROJECT_ID, --access-token becomes PHRASEAPP_ACCESS_TOKEN, etc...

All examples below are provided with the assumption that PhraseApp-related options are supplied using the following .env file:

PHRASEAPP_PROJECT_ID=2ab148c83062e85958e2b9b423eb1b5c
PHRASEAPP_ACCESS_TOKEN=4ccd6e8v8549f49ef315fd763799a639e136878494a21947d8cfb3685bfb384e
PHRASEAPP_DEFAULT_LOCALE=en

download command

Downloads all PhraseApp translations for all available languages to target path. Untranslated keys will be taken from default locale.

Usage

pa download [options] <path>
Options
  • -h, --help output usage information
  • --project-id <value> PhraseApp project ID
  • --access-token <value> PhraseApp access token
  • --fallback-locale <value> default locale code to which empty keys should fall back to
Parameters
  • path relative path to which downloaded JSON file will be written
Example

Download PhraseApp translations and save it to content.json file. Untranslated keys will be taken from default locale.

# Assuming PhraseApp options are set using .env file
pa download content.json

update command

Update specified keys for given languages in existing content JSON file. Untranslated keys will be taken from default locale.

Usage

pa update [options] <keys> <langs> <path>
Options
  • -h, --help output usage information
  • --project-id <value> PhraseApp project ID
  • --access-token <value> PhraseApp access token
  • --fallback-locale <value> default locale code to which empty keys should fall back to
Parameters
  • keys comma-separated list of keys to update
  • langs comma-separated list of languages for which keys should be updated
  • path relative path to JSON file which will be updated
Example

Download PhraseApp translations of footer and header keys for cs and en locales and update values in existing content.json file, falling back to en for missing translations.

# Assuming PhraseApp options are set using .env file
pa update footer,header cs,en content.json

upload command

Upload specified content file to PhraseApp.

Usage

pa upload [options] <path>
Options
  • -h, --help output usage information
  • --project-id <value> PhraseApp project ID
  • --access-token <value> PhraseApp access token

If you're getting a 401 error, make sure your access token is read/write.

Parameters
  • path relative path to JSON file which will be uploaded
Example

Upload JSON file content.json to PhraseApp project.

# Assuming PhraseApp options are set using .env file
pa upload content.json

License

MIT © Lusk