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

google-sheets-localizer

v1.0.0

Published

A tool to fetch and generate localization files from Google Sheets.

Readme

Google Sheets Localizer

A tool to fetch localization strings from a Google Sheets document and generate translation files for your project.


Getting Started

Follow these steps to set up and use the localizer tool in your project.

1. Create Your Google Sheet

  • Create a new Google Sheet to manage your localization keys and translations.
  • Structure your sheet as follows:
    • Row 1: First column should be the key name (e.g. greeting), subsequent columns should be language codes (e.g. en, tr, fr).
    • Row 2 onwards: Fill in your translation keys and corresponding translations for each language.

Example:

| Key | en | tr | fr | | --------- | --------- | ------------ | ----------- | | greeting | Hello | Merhaba | Bonjour | | farewell | Goodbye | Hoşça kal | Au revoir |


2. Share Your Google Sheet

  • Share the Google Sheet with the email found in your Google Cloud credentials JSON under the client_email field.
  • Give at least Viewer access so the API can read the sheet.

3. Setup Google Cloud Credentials

  • Create a project in the Google Cloud Console.
  • Enable the Google Sheets API for your project.
  • Create a Service Account and generate a JSON key file.
  • Download the JSON credentials file and save it somewhere safe.

4. Configure .env File

Create a .env file in your project root with the following keys:

GOOGLE_SHEET_ID=your_google_sheet_id_here
GOOGLE_CREDENTIALS_PATH=/absolute/path/to/your/credentials.json
GOOGLE_SHEET_RANGE=Sheet1!A1:Z1000

5. Run the Localizer

Run the command to fetch the latest translations and generate localization files:

Note: By default, the tool starts reading data from the 3rd row of the sheet (assuming the 1st row contains headers and the 2nd row contains the first data row).

npx generate-localize

The tool will:

Read the Google Sheet starting from row 2 (row 1 is assumed to be headers). Generate a JSON file with translations. Generate a TypeScript types file for localization keys. Save output files into the localize folder at the root of your project.

6. Use Generated Files in Your Project

  • The generated localize/translations.json contains all translations.
  • The generated localize/localized-keys.d.ts contains typed localization keys.
  • Import these files where needed in your project.

7. Notes

  • Ensure the Google credentials JSON file path is absolute.
  • The tool expects the first row of the sheet to contain headers.
  • Sharing the sheet correctly with the service account email is required.
  • The output directory (localize) will be created if it doesn’t exist.

Troubleshooting

  • If you get an error about missing .env variables, double-check your .env file location and contents.
  • If the credentials file is not found, verify the absolute path is correct.
  • Make sure your service account has Viewer access to the Google Sheet.

License

MIT


Author

MuazzezA