1
0
Fork 0
mirror of https://github.com/MillironX/docker-names.git synced 2024-11-15 05:53:10 +00:00
docker-names/README.md

70 lines
1.5 KiB
Markdown
Raw Normal View History

2021-04-25 15:29:08 +00:00
# Docker Names
2021-07-20 16:31:10 +00:00
An implementation of [docker-names](https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go) in TypeScript. Forked from <https://github.com/criblio/docker-names>.
## Changes
1. Added more names of scientists related to
- chemical engineering
- animal breeding
- rumen science
- among others...
2. Changed the delimiter to an underscore when adding extra data (date or number)
2021-07-20 16:31:10 +00:00
3. Added an identifier that starts with a date (useful where identifiers have to be sorted chronologically).
2021-04-25 15:29:08 +00:00
## Usage
2021-07-20 16:31:10 +00:00
Maybe this stuff will still work? :shrug: I just replaced everything with my name and code, but I personally transpile to JavaScript rather than use TypeScript directly.
2021-04-25 15:29:08 +00:00
### Generate Name
```typescript
2021-07-20 16:31:10 +00:00
import {generateName} from '@millironx/docker-names'
2021-04-25 15:29:08 +00:00
const dockerName = generateName();
console.log(dockerName);
2021-07-20 16:31:10 +00:00
//Outputs goofy_panini
2021-04-25 15:29:08 +00:00
```
### Generate Name With Number
```typescript
2021-07-20 16:31:10 +00:00
import {generateNameWithNumber} from '@millironx/docker-names'
2021-04-25 15:29:08 +00:00
const dockerName = generateNameWithNumber();
console.log(dockerName);
2021-07-20 16:31:10 +00:00
//Outputs goofy_panini_4
```
### Generate Name With Date
```typescript
import {generateNameWithDate} from '@millironx/docker-names'
const dockerName = generateNameWithDate();
console.log(dockerName);
//Outputs 20210720_goofy_panini
2021-04-25 15:29:08 +00:00
```
2021-07-20 15:30:42 +00:00
## Words
2021-04-25 15:29:08 +00:00
The words can also be imported from the package if need be.
```typescript
2021-07-20 16:31:10 +00:00
import {left,right} from '@millironx/docker-names'
2021-04-25 15:29:08 +00:00
console.log(left);
//Outputs [admiring,adoring, etc...]
console.log(right)
//Outputs [albattani,allen, etc...]
2021-07-20 15:30:42 +00:00
```