2021-04-25 15:29:08 +00:00
|
|
|
# Docker Names
|
|
|
|
|
2021-07-20 15:30:42 +00:00
|
|
|
An implementation of [docker-names](https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go) in TypeScript.
|
2021-04-25 15:29:08 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Generate Name
|
|
|
|
|
|
|
|
```typescript
|
2021-04-27 19:40:27 +00:00
|
|
|
import {generateName} from '@criblinc/docker-names'
|
2021-04-25 15:29:08 +00:00
|
|
|
|
|
|
|
const dockerName = generateName();
|
|
|
|
|
|
|
|
console.log(dockerName);
|
|
|
|
|
|
|
|
//Outputs goofy-panini
|
|
|
|
```
|
|
|
|
|
|
|
|
### Generate Name With Number
|
|
|
|
|
|
|
|
|
|
|
|
```typescript
|
2021-04-27 19:40:27 +00:00
|
|
|
import {generateNameWithNumber} from '@criblinc/docker-names'
|
2021-04-25 15:29:08 +00:00
|
|
|
|
|
|
|
const dockerName = generateNameWithNumber();
|
|
|
|
|
|
|
|
console.log(dockerName);
|
|
|
|
|
|
|
|
//Outputs goofy-panini-4
|
|
|
|
```
|
|
|
|
|
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-04-27 19:40:27 +00:00
|
|
|
import {left,right} from '@criblinc/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
|
|
|
```
|