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 🙏

© 2026 – Pkg Stats / Ryan Hefner

grunt-language-helpers

v0.1.0

Published

4 grunt task helpers for working with json base language dictionaries

Readme

grunt-language-helpers

4 grunt task helpers for working with json base language dictionaries

  • langGenerate
  • langSort
  • langCheck
  • langDiff

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-language-helpers --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-language-helpers');

The "langGenerate" task

Overview

In your project's Gruntfile, add a section named langGenerate to the data object passed into grunt.initConfig().

grunt.initConfig({
        langGenerate: {
            options:{
                source: 'languages/en.json',
                destiny: 'languages/test.json'
                /* optionals
                minify: false,
                useKeyAsValue: false,
                prefix: '[',
                suffix: ']',
                ,printInConsole:
                 {
                 source: true,
                 destiny: true
                 }
                */
            }
        }
});

This task is useful because allow you to automatically create

{
	"KEY_1": "[Translation 1]",
    "KEY_2": "[Translation 2]",
}

from model.json

{
	"KEY_1": "Translation 1",
    "KEY_2": "Translation 2",
}

So you can see straight away the parts of your app that are already translated and how.

Options

options.source

(Required) Type: String The source path to the json model language.

options.destiny

(Required) Type: String The destiny path to generated json language base on the source language.

options.minify

(Optional) Type: Boolean Default value: 'false' If the generated json file will minified or pretty formatted.

options.prefix

(Optional) Type: String Default value: '[' Prefix of translation text.

options.suffix

(Optional) Type: String Default value: ']' Suffix of translation text.

options.printInConsole.source

(Optional) Type: Boolean Default value: 'false' Print out to the console the entire source json file.

options.printInConsole.destiny

(Optional) Type: Boolean Default value: 'false' Print out to the console the entire destiny json file.

Usage Examples

Adding this task to your watch with live reload can be very useful.

The "langSort" task

Overview

In your project's Gruntfile, add a section named langSort to the data object passed into grunt.initConfig().

grunt.initConfig({
    langSort: {
          options: {
              langFolder: 'languages/',
              targets: ['en', 'es']
              //minify: false
          }
      }
});

This task is useful because allow you to automatically improve the readability of your language definition

{
	"KEY_Z": "Translation Z",
    "KEY_A": "Translation A",
}

become sorted

{
	"KEY_A": "Translation A",
    "KEY_Z": "Translation Z",
}

So it is easier to find a key and improve human readability.

Options

options.langFolder

(Required) Type: String The source path to the folder containing all the languages.

options.targets

(Required) Type: String Array The languages in that folder that you want to sort. file is expected to end in ".json".

options.minify

(Optional) Type: Boolean Default value: 'false' If the generated json will minified or pretty formatted.

The "langCheck" task

Overview

In your project's Gruntfile, add a section named langCheck to the data object passed into grunt.initConfig().

grunt.initConfig({
    langCheck: {
          options:{
              langFolder: 'languages/',
              targets: ['en', 'es']
          }
    }
});

Check if keys have the right format (A_KEY) Check if the same value is used for different keys Check for whitespace problems. * starting or ending with whitespace * multiple whitespaces together * empty values.

To do

Add regular expressions capabilities

Options

options.langFolder

(Required) Type: String The source path to the folder containing all the languages.

options.targets

(Required) Type: String Array The languages in that folder that you want to sort. files are expected to end in ".json".

The "langDiff" task

Overview

In your project's Gruntfile, add a section named langDiff to the data object passed into grunt.initConfig().

grunt.initConfig({
    langDiff: {
          options: {
              langFolder: 'languages/',
              model: 'en',
              targets: ['es']
          }
      }
});

Check for: * Missing keys in the target that are in the model. * Unexpected extra keys in the target that the model don't have.

Options

options.langFolder

(Required) Type: String The source path to the folder containing all the languages.

options.model

(Required) Type: String The model language that you know is ok.

options.targets

(Required) Type: String Array The languages in that folder that you want to check against the model language. files are expected to end in ".json".

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt. Please fell free to do pull request.

Release History

version 1.