@tgraph/utils
v0.1.1
Published
Small, side-effect-free utilities used across the real estate projects. Published publicly to npm.
Readme
@tgraph/utils
Small, side-effect-free utilities used across the real estate projects. Published publicly to npm.
Install
npm install @tgraph/utilsWhat’s inside
slugify(value: string): string— create URL-friendly slugs from human-readable strings.
Usage
import { slugify } from '@tgraph/utils';
slugify('Hello World'); // "hello-world"
slugify(' Mixed spacing '); // "mixed-spacing"
slugify('Diacritics & symbols!'); // "diacritics-symbols"
slugify('Already--slugged text'); // "already-slugged-text"Notes:
- Lowercases, trims, removes non-alphanumerics (except spaces/hyphens), collapses spaces to single hyphens, and collapses multiple hyphens.
- No external dependencies and safe to call on both client and server.
Build (from repo root)
npm run build:utilsPublish (from repo root)
npm publish --workspace packages/utils --access publicpublishConfig.access is set to public to avoid accidental private publishes for this scoped package.
Versioning note
Use semantic versioning; consumer apps should pin to a version range they’re comfortable with (e.g., ^0.1.0).
