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

use-obfuscator

v1.0.2

Published

CSS/HTML class & ID obfuscator with config file, multi-format support and exclude lists

Readme

use-obfuscator

by Roman Skrylnyk — github.com/r-skrylnyk
Inspired by obscure by Jason Yung

CSS/HTML class & ID obfuscator with config file support, multi-format files (.html, .php, .vue, .jsx) and external exclude lists.


Встановлення

npm install -g use-obfuscator

Швидкий старт (CLI)

use-obfuscator style.css --apply index.html --output ./dist --seed 42

Знаходить усі класи та ID у style.css, перейменовує їх у хеш-назви і застосовує до style.css + index.html.


Усі CLI параметри

| Параметр | Скорочення | Опис | |----------|-----------|------| | [include] | — | CSS файл(и) з визначеннями класів/ID (рядок, glob або через кому) | | --apply <files> | -a | Файли для обфускації: .html, .htm, .php, .vue, .jsx, .tsx | | --output <dir> | -o | Директорія виводу (за замовчуванням: поруч із вихідними файлами) | | --exclude <files> | -e | CSS файли, чиї класи треба пропустити (напр. Bootstrap) | | --exclude-list <file> | -x | .json або .txt файл зі списком класів для пропуску | | --seed <number> | -s | Ціле число для відтворюваної обфускації | | --config <file> | -c | Шлях до конфіг-файлу (за замовч: use-obfuscator.config.js) | | --version | -V | Версія | | --help | -h | Довідка |


Конфіг-файл

Замість довгих команд — один файл use-obfuscator.config.js у корені проєкту:

// use-obfuscator.config.js
module.exports = {
  include:     'style.css',
  apply:       ['index.html', 'about.html', 'partials/*.php'],
  output:      './dist',
  seed:        42,
  exclude:     'assets/js-cdn/bootstrap.min.css',
  excludeList: 'exclude-classes.json',
};

Запуск із конфігом — просто:

use-obfuscator

CLI-прапори завжди перевизначають значення з конфіг-файлу.


Список виключень (--exclude-list)

Деякі класи (наприклад Bootstrap, ваші JS-хуки) не потрібно обфускувати. Замість того щоб хардкодити їх у код — задайте список файлом.

JSON формат

["navbar", "active", "show", "collapse", "modal", "dropdown"]

TXT формат (один рядок — одна назва)

navbar
.active
#sidebar
show
collapse

Запуск:

use-obfuscator style.css --apply index.html --exclude-list exclude-classes.json

Батч-режим та Glob

# Всі CSS та HTML у директорії
use-obfuscator *.css --apply *.html --output ./dist

# Список через кому
use-obfuscator style.css,components.css --apply index.html,about.html

# PHP шаблони
use-obfuscator style.css --apply "partials/*.php" --output ./dist

Підтримувані формати файлів

| Формат | Спосіб обробки | Примітки | |--------|----------------|---------| | .html, .htm | cheerio (HTML mode) | Повноцінна DOM-маніпуляція | | .php | cheerio (XML mode) | Теги не нормалізуються | | .vue | cheerio (XML mode) | <template> блок обробляється | | .jsx, .tsx | cheerio (XML mode) | className атрибути оновлюються |


Вихідні файли

| Файл | Опис | |------|------| | <output>/<original_name>.css | Обфускований CSS | | <output>/<original_name>.html | Обфускований HTML/PHP/Vue | | <output>/use-obfuscator.map.json | JSON-карта з метаданими та таблицею відповідностей |

Структура map-файлу

{
  "tool": "use-obfuscator",
  "version": "1.0.0",
  "generated": "2026-03-26T10:00:00.000Z",
  "seed": 42,
  "stats": {
    "obfuscated": 127,
    "skipped": 12,
    "files": 2
  },
  "map": {
    ".container": { "sym": ".", "origin": "container", "obfused": "rAb3Kp" },
    "#header":    { "sym": "#", "origin": "header",    "obfused": "rXm9Lq" }
  }
}

Відтворювані збірки (--seed)

# Без --seed: різна обфускація при кожному запуску
use-obfuscator style.css --apply index.html

# З --seed: однаковий результат завжди
use-obfuscator style.css --apply index.html --seed 42

Рекомендовано для CI/CD — зміни в Git будуть мінімальними між збірками.


Використання у Docker

FROM node:18-bullseye-slim AS builder

RUN npm install -g use-obfuscator

WORKDIR /app
COPY . .

# З конфіг-файлом (рекомендовано)
RUN use-obfuscator

# Або напряму
# RUN use-obfuscator style.css --apply index.html --output /output/dist --seed 42

FROM alpine:3.18
COPY --from=builder /output/dist /dist

Порівняння з obscure

| Можливість | obscure | use-obfuscator | |-----------|---------|-----------------| | CSS обфускація | ✅ | ✅ | | HTML обфускація | ✅ | ✅ | | PHP / Vue / JSX | ❌ | ✅ | | Конфіг-файл | ❌ | ✅ | | Зовнішній список виключень | ❌ | ✅ | | JSON map-файл з метаданими | ❌ | ✅ | | Виправлений баг lastIndex | ❌ | ✅ | | Актуальні залежності (Node 16+) | ❌ | ✅ | | 0 вразливостей (npm audit) | ❌ | ✅ |


Структура модуля

use-obfuscator/
├── index.js                          ← CLI точка входу (bin)
├── lib/
│   ├── core.js                       ← головна функція run()
│   ├── css-parser.js                 ← парсер CSS-селекторів
│   └── config.js                     ← завантаження конфіг-файлу
├── use-obfuscator.config.example.js ← приклад конфігурації
├── package.json
├── LICENSE
└── README.md

Ліцензія

MIT © 2026 Roman Skrylnyk (etozheroma)
Inspired by obscure © 2016 Jason Yung (bitstrider)
See LICENSE.