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

nolybab-js

v1.0.5

Published

CLI based tool for converting i18n to csv and csv to i18n files

Downloads

1,297

Readme

Nolybab JS

A CLI based tool for converting i18n to csv and csv to i18n files.
This tool allow you to quickly convert all your i18n (json) files in your project into a csv file and vice versa.

Table of Contents

Install

npm install nolybab-js

Usage

npx nolybab -a to-csv
npx nolybab -a to-i18n
Options:
  -a, --action                  The action to be executed. to-csv | to-i18n
                                                             [string] [required]
  -m, --i18n-main-file-name          The name of the main i18n file
                                                        [string] [default: "en"]
  -i, --i18n-files-path         The path to the i18n files
                                             [string] [default: "src/languages"]
  -c, --csv-delimiter           The csv delimiter        [string] [default: ","]
  -n, --csv-file-name  The name of the csv translations file
                                                   [string] [default: "nolybab"]
  -p, --csv-file-path  The path to the csv translations file
                                             [string] [default: "src/languages"]

Examples

Running the command npx nolybab -a to-csv will convert the following i18n json files:

export const en = {
  hello: 'Hello',
  yes: 'Yes',
  no: 'No',
  login: {
    title: 'Login',
    message: 'Please login'
  },
  home: {
    description: 'Welcome to Nolybab',
    header: {
      title: 'Nolybab'
    },
    footer: {
      credit: '2022 Nolybab'
    },
    body: {
      about: {
        title: 'About'
      },
      contact_us: 'Contact us'
    }
  }
}

export const fr = {
  hello: 'Bonjour',
  yes: 'Oui',
  no: 'Non',
  login: {
    title: 'Connexion',
    message: 'Veuillez vous connecter'
  },
  home: {
    description: 'Bienvenue sur Nolybab',
    header: {
      title: 'Nolybab'
    },
    footer: {
      credit: '2022 Nolybab'
    },
    body: {
      about: {
        title: 'Sur'
      },
      contact_us: 'Nous contacter'
    }
  }
}

export const es = {
  hello: 'Hola',
  yes: 'Sí',
  no: 'No',
  login: {
    title: 'Acceso',
    message: 'Por favor Iniciar sesión'
  },
  home: {
    description: 'Bienvenido a nolybab',
    header: {
      title: 'Nolybab'
    },
    footer: {
      credit: '2022 Nolybab'
    },
    body: {
      about: {
        title: 'Acerca de'
      },
      contact_us: 'Contacta con nosotros'
    }
  }
}

into the following csv file:

,en,es,fr
hello,Hello,Hola,Bonjour
yes,Yes,Sí,Oui
no,No,No,Non
login.title,Login,Acceso,Connexion
login.message,Please login,Por favor Iniciar sesión,Veuillez vous connecter
home.description,Welcome to Nolybab,Bienvenido a nolybab,Bienvenue sur Nolybab
home.header.title,Nolybab,Nolybab,Nolybab
home.footer.credit,2022 Nolybab,2022 Nolybab,2022 Nolybab
home.body.about.title,About,Acerca de,Sur
home.body.contact_us,Contact us,Contacta con nosotros,Nous contacter

CSV file

Running the command npx nolybab -a to-i18n will convert the csv back into the i18n json files above

License

MIT