# @coli.codes/naming

> - variable naming - route naming - entity naming - file naming - directory naming

Latest version **0.0.34** (published 2024-02-23) · 0 weekly downloads

## Install

```sh
npm install @coli.codes/naming
pnpm add @coli.codes/naming
yarn add @coli.codes/naming
bun add @coli.codes/naming
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.34 |
| Published | 2024-02-23 |
| First published | 2022-07-28 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 40 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | softmarshmallow, heejun_dev |
| Keywords | variable name builder |

## Links

- npm: https://www.npmjs.com/package/@coli.codes/naming
- npm.io page: https://npm.io/package/@coli.codes/naming

## Recent versions

- 0.0.34 (latest) — 2024-02-23
- 0.0.32 — 2022-09-15
- 0.0.31 — 2022-08-20
- 0.0.30 — 2022-08-20
- 0.0.29 — 2022-08-15
- 0.0.28 — 2022-08-07
- 0.0.27 — 2022-07-31
- 0.0.26 — 2022-07-31
- 0.0.25 — 2022-07-31
- 0.0.24 — 2022-07-30
- 0.0.23 — 2022-07-30
- 0.0.21 — 2022-07-30
- 0.0.20 — 2022-07-30
- 0.0.17 — 2022-07-30
- 0.0.16 — 2022-07-30
- … 1 more at https://npm.io/package/@coli.codes/naming/versions

## README

# Coli Naming

- variable naming
- route naming
- entity naming
- file naming
- directory naming

## Installation & Usage

```sh
yarn add @coli.codes/naming
```

```ts
import { nameit } from "@coli.codes/nameit";

nameit("Content Wrap"); // - [ContentWrap, contentWrap, content-wrap, content_wrap, CONTENT_WRAP, contentwrap]

// of course, you can pass the configurations.
```

## Scope handling

with `ScopedNamer` you can pervent confliction of each identifiers' name

**conflict prevent prefix/suffix**

- +n - [`conflicting-name-0`, `conflicting-name-1`]
- +hash - [`conflicting-name-GT3`, `conflicting-name-AG9`]
- +named entity (not recommanded) - [`conflicting-name-white`, `conflicting-name-ambient`]
- +single conflicting underscore escape - [`conflicting_name`, `_conflicting_name` or `__conflicting_name`]

## Exceptional realworld scenarios (supported)

**nextjs' page route naming**

- `[slug].js`
- `_app.js`

## Usecases

- const Wrapper = styled.div`~`;
- interface IModel {}
- class Model {}
- function add () {}
- function Component () {}
- pages/[slug].js
- const \_memberVar = calc(porps.value)
- const API_SECRET = "alza0000"
- function checkIfThatIsTrue() : boolean
- const isSomethingTrue : boolean

## Input scenario

`/` is a seperator, it can be replaced with cases - 'a/b' -> "AB", "aB", "a_b", "\_a_b", etc..

- "+-$" - "plus/minus/dollarsign"
- "- Dollar" - "\_/dollar"
- "Hi" - "hi"
- "Content wrap" - "content/wrap"
- "" - "unnamed/rand()"
- "_" - "_"
- "$" - "dollarsign" (`$` is a valid name is es, but not a good pattern, you have to specify it as a sign keyword in order to use it - see it below)
- Unique.dollarsign - "$"

---
_Source: https://npm.io/package/@coli.codes/naming · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
