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

zanata-js

v2.2.4

Published

Zanata API library in JavaScript

Downloads

40

Readme

zanata-js NPM version

zanata-js is a Client library for Zanata in JavaScript. Zanata is a web-based system for translators, content creators and developers to manage localization projects. this library provides APIs to access to zanata from JavaScript-based projects.

Installation

#!shell

% npm install zanata-js

Getting Started with CLI

Common Options

-U, --url=<URL>

Specify the URL to the Zanata server where you want to connect. this can be omitted if you download zanata.xml from the Zanata.

-u, --user=<USER>

Specify your account name on the Zanata. this can be omitted if you add your account name into zanata.ini according to the [instructions](https://github.com/zanata/zanata-p latform/blob/master/docs/client/configuration.md).

-K, --api-key=<KEY>

Specify your API key to access the Zanata API. this can be omitted if you add your API key into zanata.ini.

--disable-ssl-cert

If you see any trouble to access to the Zanata via SSL, you can use this option as a workaround. though this isn't recommended.

Project management

Common Options for projects

-C, --config=<FILE>

Specify the place to zanata.xml which you want to read for the project. the default behavior is to read it on the current directory though, if you want to use the different one, this may helps.

How to get all of projects available on the Zanata

Command
$ zanata-js project list
Options
-c, --column=<column name,...>

Columns you want to show is customizable with this option. the available column name is, id, name, defaultType, status, and all. id, name and status is displayed by default.

How to create a project in the Zanata

Command
$ zanata-js project create [options] `<project id>`

Create a project with project id.

Options
-d, --description=<DESCRIPTION>

The project description. this is optional.

-p, --project=<NAME>

The project name. this is required to create.

-t --project-type=<TYPE>

The default project type. this will be used if you didn't specify the project type when creating a version. the available project type will be File, Gettext, Podir, Properties, Utf8Properties, Xliff, and `Xml'. See the Zanata document for more details.

How to show the project information

Command
$ zanata-js project info [options] `<project id>` ...
Options
-l, --show-locales

Show available languages for translating.

How to create a version in the project

Command
$ zanata-js project create-version [options] `<project version id>` ...
Options
-p, --project=<PROJECT ID>

Specify the project id to create a version for. this can be omitted if you have this in zanata.xml.

-t, --project-type<TYPE>

Specify the project type for a version. this can be omitted if you want to inherit the default project type which you specified when creating a project.

How to show the project version information

Command
$ zanata-js project version-info [options] `<project version id>` ...
Options
-p, --project=<PROJECT ID>

Specify the project id to show the version information for. this can be omitted if you have this in zanata.xml.

-l, --show-locales

Show available languages for translating on the version.

How to pull translations from the Zanata

Command
$ zanata-js project pull [options]
Options
-p, --project=<PROJECT ID>

Specify the project id to pull the translations for. this can be omitted if you have this in zanata.xml.

-V, --project-version=<VERSION ID>

Specify the project version id to pull the translations for. this can be omitted if you have this in zanata.xml.

-t, --project-type=<TYPE>

Specify the project type. this can be omitted if you have this in zanata.xml.

-T, --pull-type=<TYPE>

Specify what the sort of documentation you want to pull. the available type is, source, trans, and both. the default pull type is trans.

-l, --locales=<LOCALE,...>

Specify the locales you want to pull.

-k, --create-skeletons

Create skeleton entries for languages which haven't yet been translated on the Zanata. languages that have any translations will be pulled and stored into the file by default.

--pot-dir=<DIR>

Specify the place to store the POT file.

--po-dir=<DIR>

Specify the place to store the PO files.

-f, --force

Force to transfer the data.

-v, --verbose

Show more progress message verbosely.

--dry-run

Do not store the data into the files.

How to push translations to the Zanata

Command
$ zanata-js project push [options]
Options
-p, --project=<PROJECT ID>

Specify the project id to push documents to the Zanata. this can be omitted if you have this in zanata.xml.

-V, --project-version<VERSION ID>

Specify the project version id to push documents to the Zanata. this can be omitted if you have this in zanata.xml.

-t, --project-type=<TYPE>

Specify the project type. this can be omitted if you have this in zanata.xml.

-T, --push-type=<TYPE>

Specify what the sort of documentation you want to push. the available type is, source, trans, and both. the default push type is trans.

-l, --locales=<LOCALE, ...>

Specify the locales you want to push.

--pot-dir=<DIR>

Specify the place to push the POT file on.

--po-dir=<DIR>

Specify the place to push the PO files on.

--copy-trans=<BOOLEAN>

Copy the latest translations from equivalent messages/documents in the translation memory of the Zanata.

--dry-run

Do not push the documentation to the Zanata actually.

-v, --verbose

Show more progress messages verbosely.

How to show the statistics for the project

Command
$ zanata-js project stats [options]
Options
-p, --project=<PROJECT ID>

Specify the project id get statistics for from the Zanata. this can be omitted if you have this in zanata.xml.

-V, --project-version=<VERSION ID>

Specify the project version id get statistics for from the Zanata. this can be omitted if you have this in zanata.xml.

-D, --doc-id=<DOC ID>

Specify the document id get statistics for from the Zanata. this is optional and may only helps if you have multiple documents in the version.

-d, --detail

Show the detailed statistics.

-w, --word

Show the word-level statistics.

-l, --locales=<LOCALE, ...>

Specify the locales you want to get statistics for.

-v, --verbose

Show more progress messages verbosely.

Getting Started with API

const ZanataClient = require('zanata-js').ZanataClient;

let project = new ZanataClient.Project(options)
  .on('fail', (e) => console.error)
  .on('data', (d) => {
    ...
  })
  .on('end', (r) => {
    ...
  })
  .pull({project: 'project id', version: 'version id', ....});

For sample code, zanata-js CLI or grunt-zanata-js may helps to speed up understanding.

API Reference

See https://tagoh.bitbucket.io/zanata-js/ for more details.

License

MIT