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

@empathyco/x-translations

v2.0.3-alpha.2

Published

A project which allows the user to import and export the translations.

Downloads

700

Readme

Manage Translations JSON to CSV and CSV to JSON

This project converts a JSON file with translations to a CSV and in the other way around.

How to use it

Params

It receives two parameters, the first one should be the path of file to be converted (it is mandatory), and the second one is the target path where the translations are going to be exported (it is not mandatory, a default folder will be created if the param is not sent)

  • sourcePath: path of file to be converted.
  • targetPath: destination path to export the file converted.

Run it as script

Run the following command to translate from a JSON to a CSV:

ts-node ./src/json-to-csv.ts ./src/__tests__/json/en.messages.json
ts-node ./src/json-to-csv.ts ./src/__tests__/json/en_translations.json ./TargetPath

If you want to transform multiple files, you can use the path:

ts-node ./src/json-to-csv.ts ./src/__tests__/json
ts-node ./src/json-to-csv.ts ./src/__tests__/json ./TargetPath

Run the following command to translate from a CSV to a JSON:

ts-node ./src/csv-to-json.ts ./src/__tests__/csv/en.messages.csv
ts-node ./src/csv-to-json.ts ./src/__tests__/csv/en.messages.csv ./TargetPath

If you want to transform multiple files, you can use the path:

ts-node ./src/csv-to-json.ts ./src/__tests__/csv
ts-node ./src/csv-to-json.ts ./src/__tests__/csv ./TargetPath

Run it as a dependency

  1. npm install @empathyco/x-translations

  2. run the command to transform a JSON to a CSV:

    • json-csv ./src/__tests__/json/en.messages.json
    • json-csv ./src/__tests__/json/en.messages.json ./TargetPath
    • To transform multiple files, use the path where the files are stored:
      • json-csv ./src/__tests__/json
      • json-csv ./src/__tests__/json ./TargetPath
  3. run the command to transform a CSV to a JSON:

    • csv-json ./src/__tests__/csv/en_translations.csv
    • csv-json ./src/__tests__/csv/en_translations.csv ./TargetPath
    • To transform multiple files, use the path where the files are stored:
      • csv-json ./src/__tests__/csv
      • csv-json ./src/__tests__/csv ./TargetPath