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

tenpercent

v1.0.1

Published

[![GitHub license](https://img.shields.io/github/license/greatislander/tenpercent.svg)](https://github.com/greatislander/tenpercent/blob/master/LICENSE.md) ![Codeship](https://img.shields.io/codeship/d28115150-1682-0136-0129-16efa7467c65/master.svg)

Downloads

6

Readme

Ten Percent

GitHub license Codeship

Ten Percent (l10n percent) is a Node.js microservice which uses the Transifex REST API to retrieve the localization status of a given Transifex resource. I made Ten Percent so that I could use a Shields.io dynamic badge to display the localization status of the Pressbooks Open Source project's resources and encourage ongoing localization efforts. Hopefully others will find it useful for their projects as well.

Requirements

Setup

  1. Install the Now CLI on your device and log in to your Now account.
  2. Add your Transifex API token as a secret:
$ now secrets add transifex-api-token "<TOKEN>"
  1. Deploy greatislander/tenpercent to Now. Be sure to assign the secret you created in step 2 to the TRANSIFEX_API_TOKEN environment variable:
$ now greatislander/tenpercent -e TRANSIFEX_API_TOKEN=@transifex-api-token

Usage

  1. Visit your Now deploy, supplying the query parameters for organization, project, and optionally resource (resource defaults to 0, the first resource by numeric index; if the project has multiple resources, you can select the appropriate one by supplying a different value). Verify that the resulting JSON object reflects the localization status of the desired resource (a numeric value corresponding to the percentage translated):
$ curl 'https://<SUBDOMAIN>.now.sh?organization=<ORGANIZATION>&project=<PROJECT>[&resource=<RESOURCE INDEX>]'
$ {"status":"10"}

If the API token is missing or invalid or if you have specified a non-existent Transifex organization, project or resource, status will provide an error message.

  1. Use the URL you determined in step 1 to generate a Shields.io dynamic badge that shows the localization status of your Transifex project. You'll need to set the data type to JSON and the query to $.status.
https://img.shields.io/badge/dynamic/json.svg?url=<URL>&label=translated&query=$.status.&colorB=<COLOR>&prefix=<PREFIX>&suffix=%25

This URL will produce the following badge layout with the example response in step 1:

Example Badge

Now you can add a badge to your GitHub readme which will reflect the current localization status of your project.

Notes

Responses from the Transifex REST API are cached for 24 hours to prevent excessive API calls, so you may not see the changes immediately.