Skip to content

Commit 69579b5

Browse files
committed
chore: wip
1 parent f974409 commit 69579b5

File tree

8 files changed

+474
-308
lines changed

8 files changed

+474
-308
lines changed

README.md

Lines changed: 151 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,180 @@
66
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
77
<!-- [![Codecov][codecov-src]][codecov-href] -->
88

9-
# bun-ts-starter
9+
# nanofaker
1010

11-
This is an opinionated TypeScript Starter kit to help kick-start development of your next Bun package.
11+
A performance-focused and lightweight faker library for TypeScript with comprehensive locale support.
1212

1313
## Features
1414

15-
This Starter Kit comes pre-configured with the following:
15+
- ⚡️ **Performance-focused** - Built with speed and efficiency in mind
16+
- 🌍 **Multi-locale Support** - Complete translations for 9 languages:
17+
- English (en)
18+
- Spanish (es)
19+
- French (fr)
20+
- German (de)
21+
- Italian (it)
22+
- Portuguese (pt)
23+
- Japanese (ja)
24+
- Filipino (tl)
25+
- Chinese (zh)
26+
- 📦 **Lightweight** - Minimal dependencies and small bundle size
27+
- 💪 **Fully Typed** - Written in TypeScript with comprehensive type definitions
28+
- 🎯 **Comprehensive Data** - 16+ data categories including:
29+
- Person (names, job titles, genders)
30+
- Address (streets, cities, countries)
31+
- Company (names, industries, buzzwords)
32+
- Internet (emails, domains)
33+
- Phone numbers
34+
- Food (dishes, ingredients, cuisines)
35+
- Animals (dogs, cats, birds, fish, etc.)
36+
- Sports (teams, athletes)
37+
- Music (genres, artists, songs)
38+
- Commerce (products, colors, materials)
39+
- Books (titles, authors, publishers)
40+
- Vehicles (manufacturers, models, types)
41+
- Words (adjectives, verbs, nouns, etc.)
42+
- Hacker/Tech (abbreviations, phrases)
43+
- System (file names, file types)
44+
- Science (elements, units, constants)
45+
46+
## Installation
1647

17-
- 🛠️ [Powerful Build Process](https://github.com/oven-sh/bun) - via Bun
18-
- 💪🏽 [Fully Typed APIs](https://www.typescriptlang.org/) - via TypeScript
19-
- 📚 [Documentation-ready](https://vitepress.dev/) - via VitePress
20-
-[CLI & Binary](https://www.npmjs.com/package/bunx) - via Bun & CAC
21-
- 🧪 [Built With Testing In Mind](https://bun.sh/docs/cli/test) - pre-configured unit-testing powered by [Bun](https://bun.sh/docs/cli/test)
22-
- 🤖 [Renovate](https://renovatebot.com/) - optimized & automated PR dependency updates
23-
- 🎨 [ESLint](https://eslint.org/) - for code linting _(and formatting)_
24-
- 📦️ [pkg.pr.new](https://pkg.pr.new) - Continuous (Preview) Releases for your libraries
25-
- 🐙 [GitHub Actions](https://github.com/features/actions) - runs your CI _(fixes code style issues, tags releases & creates its changelogs, runs the test suite, etc.)_
48+
```bash
49+
# npm
50+
npm install nanofaker
2651

27-
## Get Started
52+
# pnpm
53+
pnpm add nanofaker
2854

29-
It's rather simple to get your package development started:
55+
# bun
56+
bun add nanofaker
3057

31-
```bash
32-
# you may use this GitHub template or the following command:
33-
bunx degit stacksjs/ts-starter my-pkg
34-
cd my-pkg
58+
# yarn
59+
yarn add nanofaker
60+
```
3561

36-
bun i # install all deps
37-
bun run build # builds the library for production-ready use
62+
## Usage
3863

39-
# after you have successfully committed, you may create a "release"
40-
bun run release # automates git commits, versioning, and changelog generations
64+
```typescript
65+
import { faker } from 'nanofaker'
66+
67+
// Generate random data with default locale (English)
68+
const name = faker.person.fullName()
69+
const email = faker.internet.email()
70+
const address = faker.address.city()
71+
72+
console.log(name) // "John Doe"
73+
console.log(email) // "john.doe@example.com"
74+
console.log(address) // "New York"
4175
```
4276

43-
_Check out the package.json scripts for more commands._
77+
### Using Different Locales
78+
79+
```typescript
80+
import { faker } from 'nanofaker'
81+
82+
// Set locale globally
83+
faker.locale = 'es' // Spanish
84+
console.log(faker.person.fullName()) // "María García"
85+
86+
// Or use a specific locale instance
87+
import { es, ja, zh } from 'nanofaker/locales'
88+
89+
const spanishFaker = faker.locale('es')
90+
const japaneseFaker = faker.locale('ja')
91+
const chineseFaker = faker.locale('zh')
92+
93+
console.log(spanishFaker.person.fullName()) // "Carlos López"
94+
console.log(japaneseFaker.person.fullName()) // "田中太郎"
95+
console.log(chineseFaker.person.fullName()) // "王伟"
96+
```
97+
98+
### Available Locales
99+
100+
- `en` - English
101+
- `es` - Spanish
102+
- `fr` - French
103+
- `de` - German
104+
- `it` - Italian
105+
- `pt` - Portuguese
106+
- `ja` - Japanese
107+
- `tl` - Filipino
108+
- `zh` - Chinese
109+
110+
### API Examples
111+
112+
```typescript
113+
import { faker } from 'nanofaker'
114+
115+
// Person
116+
faker.person.firstName() // Random first name
117+
faker.person.lastName() // Random last name
118+
faker.person.fullName() // Random full name
119+
faker.person.gender() // Random gender
120+
faker.person.jobTitle() // Random job title
121+
faker.person.prefix() // Random prefix (Mr., Mrs., etc.)
122+
faker.person.suffix() // Random suffix (Jr., Sr., etc.)
123+
124+
// Address
125+
faker.address.street() // Random street name
126+
faker.address.city() // Random city
127+
faker.address.state() // Random state/province
128+
faker.address.country() // Random country
129+
faker.address.zipCode() // Random ZIP/postal code
130+
faker.address.direction() // Random direction (North, South, etc.)
131+
132+
// Company
133+
faker.company.name() // Random company name
134+
faker.company.industry() // Random industry
135+
faker.company.buzzword() // Random business buzzword
136+
137+
// Internet
138+
faker.internet.email() // Random email address
139+
faker.internet.domainName() // Random domain name
140+
faker.internet.url() // Random URL
141+
142+
// Phone
143+
faker.phone.number() // Random phone number
144+
145+
// And many more...
146+
```
44147

45148
## Testing
46149

47150
```bash
48151
bun test
49152
```
50153

154+
## Development
155+
156+
```bash
157+
# Install dependencies
158+
bun install
159+
160+
# Run tests
161+
bun test
162+
163+
# Build the library
164+
bun run build
165+
166+
# Lint code
167+
bun run lint
168+
```
169+
51170
## Changelog
52171

53-
Please see our [releases](https://github.com/stackjs/bun-ts-starter/releases) page for more information on what has changed recently.
172+
Please see our [releases](https://github.com/stacksjs/nanofaker/releases) page for more information on what has changed recently.
54173

55174
## Contributing
56175

57-
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
176+
We welcome contributions! Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
58177

59178
## Community
60179

61180
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
62181

63-
[Discussions on GitHub](https://github.com/stacksjs/ts-starter/discussions)
182+
[Discussions on GitHub](https://github.com/stacksjs/nanofaker/discussions)
64183

65184
For casual chit-chat with others using this package:
66185

@@ -86,10 +205,10 @@ The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.
86205
Made with 💙
87206

88207
<!-- Badges -->
89-
[npm-version-src]: https://img.shields.io/npm/v/bun-ts-starter?style=flat-square
90-
[npm-version-href]: https://npmjs.com/package/bun-ts-starter
91-
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/ts-starter/ci.yml?style=flat-square&branch=main
92-
[github-actions-href]: https://github.com/stacksjs/ts-starter/actions?query=workflow%3Aci
208+
[npm-version-src]: https://img.shields.io/npm/v/nanofaker?style=flat-square
209+
[npm-version-href]: https://npmjs.com/package/nanofaker
210+
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/nanofaker/ci.yml?style=flat-square&branch=main
211+
[github-actions-href]: https://github.com/stacksjs/nanofaker/actions?query=workflow%3Aci
93212

94-
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/ts-starter/main?style=flat-square
95-
[codecov-href]: https://codecov.io/gh/stacksjs/ts-starter -->
213+
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/nanofaker/main?style=flat-square
214+
[codecov-href]: https://codecov.io/gh/stacksjs/nanofaker -->

docs/.vitepress/config.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const nav = [
2222
{ text: 'News', link: 'https://stacksjs.org/news' },
2323
{
2424
text: 'Changelog',
25-
link: 'https://github.com/stacksjs/ts-starter/blob/main/CHANGELOG.md',
25+
link: 'https://github.com/stacksjs/nanofaker/blob/main/CHANGELOG.md',
2626
},
2727
// { text: 'Blog', link: 'https://updates.ow3.org' },
2828
{
@@ -62,13 +62,13 @@ const sidebar = [
6262
},
6363
{ text: 'Showcase', link: '/Showcase' },
6464
]
65-
const description = 'A TypeScript Starter Kit. For a better Development Experience.'
66-
const title = 'ts-starter | A TypeScript Starter Kit. For a better Development Experience.'
65+
const description = 'A performance-focused and lightweight faker library for TypeScript with comprehensive locale support.'
66+
const title = 'nanofaker | A performance-focused and lightweight faker library for TypeScript'
6767

6868
export default withPwa(
6969
defineConfig({
7070
lang: 'en-US',
71-
title: 'ts-starter',
71+
title: 'nanofaker',
7272
description,
7373
metaChunk: true,
7474
cleanUrls: true,
@@ -83,17 +83,17 @@ export default withPwa(
8383
['meta', { name: 'author', content: 'Stacks.js, Inc.' }],
8484
['meta', {
8585
name: 'tags',
86-
content: 'ts-starter, stacksjs, reverse proxy, modern, lightweight, zero-config, local development',
86+
content: 'nanofaker, faker, fake data, typescript, stacksjs, locale support, performance, lightweight',
8787
}],
8888

8989
['meta', { property: 'og:type', content: 'website' }],
9090
['meta', { property: 'og:locale', content: 'en' }],
9191
['meta', { property: 'og:title', content: title }],
9292
['meta', { property: 'og:description', content: description }],
9393

94-
['meta', { property: 'og:site_name', content: 'ts-starter' }],
94+
['meta', { property: 'og:site_name', content: 'nanofaker' }],
9595
['meta', { property: 'og:image', content: './images/og-image.jpg' }],
96-
['meta', { property: 'og:url', content: 'https://reverse-proxy.sh/' }],
96+
['meta', { property: 'og:url', content: 'https://nanofaker.stacksjs.org/' }],
9797
// ['script', { 'src': 'https://cdn.usefathom.com/script.js', 'data-site': '', 'data-spa': 'auto', 'defer': '' }],
9898
...analyticsHead,
9999
],
@@ -111,7 +111,7 @@ export default withPwa(
111111
sidebar,
112112

113113
editLink: {
114-
pattern: 'https://github.com/stacksjs/stacks/edit/main/docs/docs/:path',
114+
pattern: 'https://github.com/stacksjs/nanofaker/edit/main/docs/:path',
115115
text: 'Edit this page on GitHub',
116116
},
117117

@@ -123,7 +123,7 @@ export default withPwa(
123123
socialLinks: [
124124
{ icon: 'twitter', link: 'https://twitter.com/stacksjs' },
125125
{ icon: 'bluesky', link: 'https://bsky.app/profile/chrisbreuer.dev' },
126-
{ icon: 'github', link: 'https://github.com/stacksjs/ts-starter' },
126+
{ icon: 'github', link: 'https://github.com/stacksjs/nanofaker' },
127127
{ icon: 'discord', link: 'https://discord.gg/stacksjs' },
128128
],
129129

0 commit comments

Comments
 (0)