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

@electric-sql/pglite-icu-full

v0.1.0

Published

ICU support

Readme

pglite-icu-full

A package containing all the data resources from libicu that can be used with PGlite to build localized applications.

Installation

npm install @electric-sql/pglite-icu-full
# or
yarn add @electric-sql/pglite-icu-full
# or
pnpm add @electric-sql/pglite-icu-full

Usage

This loads the entire locale set provided by libicu, which might be quite large.

import { PGlite } from '@electric-sql/pglite'
import { icuDataDir } from '@electric-sql/pglite-icu-full'

// Create a PGlite instance with the icu resources
const pg = await PGlite.create({
  icuDataDir: await icuDataDir(),
})

// just an example, query the available collations
const collations = await pg.exec('select * from pg_collation')

Generating an ICU package for PGlite

Following is a brief description on how to generate your own icu file that contains only the locales that you want in your PGlite enabled application.

Download libicu code and data

Currently PGlite is tested to work with libicu v76.1. Get the source and data for it:

wget https://github.com/unicode-org/icu/releases/download/release-76-1/icu4c-76_1-src.tgz wget https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-data.zip

Important: You must have the data sources in order to use the ICU Data Build Tool. Check for the file icu4c/source/data/locales/root.txt. If that file is missing, you need to download “icu4c-*-data.zip”, delete the old icu4c/source/data directory, and replace it with the data directory from the zip file. If there is a *.dat file in icu4c/source/data/in, that file will be used even if you gave ICU custom filter rules.

Create a filters.json file

This will allow you to only generate the data that you need.

Here's a simple example:

{
  "localeFilter": {
    "filterType": "locale",
    "includelist": [
      "en_US"
    ]
  }
}

For more info, see https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html.

Build ICU

$ ICU_DATA_FILTER_FILE=<full_path_to_your_filters.json> ./icu/source/configure --with-data-packaging=files --disable-shared --enable-static --disable-tests --disable-samples --disable-extras --disable-icuio --disable-layoutex --prefix=<your_install_dir>

$ make -j && make install

Create an archive with the icu data

The previous steps have installed everything related to ICU in <your_install_dir>. You only need the data files:

$ cd <your_install_dir>/share/icu/76.1/ && tar cvfz icu_76.tgz icudt76l/

Now icu_76.tgz contains the localisation data that you can use with PGlite.

// load your newly generate icu archive
const icuDataDir = await fs.readFile(
  resolve(import.meta.dirname, 'icu_76.tgz'),
)
// now pass it to PGlite
pg = await PGlite.create({
  icuDataDir: new Blob([new Uint8Array(icuDataDir)]),
})

Example

The folder examples/Switzerland contains the filter.json and the generated data file that can be used with PGlite.

Documentation

https://www.postgresql.org/docs/current/locale.html https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html