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

i18n-csv-loader

v1.0.3

Published

A i18n webpack loader that loads csv files

Readme

i18n-csv-loader

Purpose

A webpack loader that loads CSV files into a module.

Files like example.strings.csv

_key | en | pt ------------|-------------|---------- yes | Yes | Sim no | No | Não hello world | Hello world | Olá mundo

can be used like:

    import strings from './example.strings.csv';

    // use strings[lang][key]

    console.log(strings['en']['hello world']);  // output: "Hello world"
    console.log(strings['pt']['hello world']);  // output: "Olá mundo"

Installation

  1. Install
    npm install --save i18n-csv-loader
  1. Add the rule to your webpack.config.js
const config = {
    module: {
        rules: [
            {
                test: /\.strings\.csv$/,
                use: ['i18n-csv-loader']
            },
        ],
    },
}

Options

Option | Default| Description
-------|--------|-------------------------- key | '_key'| Header of the key column

you can set your options in webpack like

    ...
        use: [
            {
                loader: 'i18n-csv-loader',
                options: {
                    key: '_key',
                },
            },
        ],
    ...

The CSV files

  • CSV files are parsed by csvtojson using the default settings which include some auto detection, but keep as close to the RF4180 specification
  • empty lines or lines with an empty key column are ignored
  • first line should contain the header which should contain
    • _key - indicates that this column will contain the key index used to select the string
    • headers started by _ will be ignored (useful if you want to have a descriptive column to indicate the context or indicate which tags will be supported for string replacement)
    • any other headers will be considered as language identifiers

Tools

Because sometimes is useful to merge all the strings into a single file (to share with a translator for instance), a couple of scripts are included to facilitate this job

  • export-strings

    Exports all strings into a single file (a column with the filename is added to allow the import process)

    example:

        npx export-strings --files `find -name *.strings.csv` -o allstrings.csv
  • import-strings

    Imports previously a previously exported file, updating the matching keys

    example:

        npx import-strings -i allstrings.csv

To do

  • [ ] allow configuration of the CSV properties for non standard versions
  • [ ] export and import scripts should change file paths to be relative to the project root

Credits