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

@imlogram/parser

v0.1.3

Published

Segmentation and tokenization engine that protects code/URL/HTML/JSON regions from Uzbek Latin alphabet conversion.

Downloads

43

Readme

@imlogram/parser

npm License: MIT

Matnni himoyalangan zonalar (URL, email, kod bloklari, HTML teglari, front-matter) va oddiy matnga ajratadigan segmentatsiya dvigateli. @imlogram/core şu paket ustiga qurilgan — u qaysi qismlarni özgartiriş mumkinligini, qaysilarini özgartirib bölmasligini şu yerdan biladi.

Odatda bu paketni töğridan-töğri emas, @imlogram/core orqali işlatasiz. Faqat özingizning maxsus matn-qayta-işlaş vositangizni qurmoqçi bölsangiz (masalan, özbek matnidan boşqa narsa qilmoqçi bölsangiz, lekin baribir kod/URL xavfsizligi kerak bölsa), buni alohida işlatişingiz mumkin.

Örnatiş

pnpm add @imlogram/parser
# yoki: npm install @imlogram/parser

Tezkor boşlaş

import { segment } from "@imlogram/parser";

const segments = segment("Sayt: https://example.com/Shop haqida gapiraylik.");

for (const seg of segments) {
  console.log(seg.kind, JSON.stringify(seg.raw));
}
// text  "Sayt: "
// url   "https://example.com/Shop"
// text  " haqida gapiraylik."

Manba kod fayllari (.ts/.tsx) uçun alohida rejim bor — bunda standart teskari: hamma narsa kod deb hisoblanadi, faqat tabiiy-tilga öxşagan string literal va JSX matn tugunlari "matn" deb belgilanadi:

import { segmentSourceCode } from "@imlogram/parser";

const segments = segmentSourceCode(`
  const label = "Kirish matni"; // matn — konvertatsiya qilinadi
  const className = "rounded-full px-4"; // kod-shaklidagi satr — himoyalangan
`);

API

segment(text: string): Segment[]

Matnni Segment[] massiviga ajratadi. Har bir segment butun kiriş matnini töliq qoplaydi (böşliq yoki ustma-ustlik yöq) — segments.map(s => s.raw).join("") har doim asl matnga teng.

interface Segment {
  kind: "text" | "url" | "email" | "code-block" | "inline-code"
      | "html-tag" | "html-entity" | "front-matter";
  raw: string;
  start: number;
  end: number;
}

segmentSourceCode(source: string): Segment[]

Xuddi şunday, lekin manba kod uçun möljallangan — teskari standart bilan (yuqorida tuşuntirilgan). Faqat "text" (konvertatsiya qilinadigan) va "code-block" (himoyalangan) turlarini qaytaradi.

Nima himoyalanadi

| Zona turi | Misol | |---|---| | URL | https://example.com/Shop | | Email | [email protected] | | Kod bloki (fenced) | ```js\nconst x = 1;\n``` | | Inline kod | `ShoppingCart` | | HTML teg + atributlar | <div className="rounded-full"> | | Front-matter | Fayl boşidagi ---\n...\n--- bloki |

Boğliq paketlar

  • @imlogram/core — bu paket ustiga qurilgan haqiqiy konvertatsiya, aniqlaş va statistika mantiği.

Havolalar

Litsenziya

MIT