docker-names-ts
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

Docker-Names-TS

If no name is provided by the user while creating/running a Docker container, Docker automatically assigns the container a name.

examples:

adoring_galileo
amazing_kalam
hardcore_kare

Also you can see it from docker client list command: Screen-Shot-2022-07-22-at-11-16-03-PM

How to use it?

this module exports only one method:

import { dockerNames } from 'docker-names-ts';
console.log(dockerNames.getRandomName());

$ amazing_kalam

Additionally, getRandomName accepts an optional parameter length which is the length of the random characters to be generated.

console.log(dockerNames.getRandomName(10));

$ amazing_kalam_skd23fsdkj

Note: you can leave an optional parameter true to generate a random name with a 6 length.

* As you can see using Math.random which means its not very random. These names should never be used as any sort of unique id. The names are mostly applicable for small lists of ephemeral objects that you want to have easy to remember identifiers for.

Contributing

Contributions are always welcome!

Package Sidebar

Install

npm i docker-names-ts

Weekly Downloads

5

Version

1.2.4

License

MIT

Unpacked Size

56 kB

Total Files

9

Last publish

Collaborators

  • vashian