npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@odczynflnpm/laudantium-vitae-saepe

v1.0.0

Published

A library to generate human-readable IDs.

Downloads

4

Maintainers

ducvinh101011zducvinh101011z

Keywords

ReactiveXbrowserlistCSSStyleDeclarationEStypesafeArrayBuffersliceproxycloudfrontfastcopyautoprefixercheckcommandtraverseUint8ClampedArraylibphonenumbergraphqlObject.definePropertyargumentcss nestingWebSocketless.jsdebugrecursivetesterfastcloneelectrononcestatelesshasOwnPropertycloudsearchmake dirstyledescriptorsrapiddeterministicnopeassigncss variableUint8ArrayxtermbcryptprotobufwatchflagsdirectoryamazonECMAScript 5regular expressionsenvironmentpromisehookstoSortedgroupByslotbddloggerECMAScript 3robusttrimRightdataViewes-abstractairbnbrm -rftoolkitlogES3beanstalksyntaxfind-upvalidationstreams2superagentgetOwnPropertyDescriptorhttpsstyled-componentstrimStartjsxauthenticationlocationparsingserializationmatchescloudwatchfilereuseexpressionless mixinscallbindflatpackagesfast-deep-cloneECMAScript 2023fastifyprunezeroObservableRxECMAScript 2022estreereact-hooksWeakMapdirhotcreateimmerprogressRegExp#flagsperformantdayjstestcolumnsprotoinspectpostcssreact-hook-formcss-in-jsredactWebSocketsJSONpropless cssjsdiffnodejsec2rangeerrorlivebootstrap cssES7Uint32Arraynegative zeroclonemergequoteawssyntaxerrorerrorwatchFilepersistenttoArraygetclassnameslastes2015joimocharatelimitcontainsurlio-tsaccessibilityrgbgrouphardlinksagentfindtypeerrorchaistateArray.prototype.findLastIndexsymbolequalruntimeeventscolorstouchprettytypedarrayendergradients cssshellmatchextensionawaitIteratori18nformsymlinkcliconcatMapStreamdateES6reactshareddefinePropertydeletehashajaxsetPrototypeOfcollectionencryptionstdlibfpsdeepcopyRFC-6455commandergdprgradients css3eslint-pluginformattingutil.inspectauthparseres2016taskeslintconfigkeystylesredux-toolkitstylesheetdebuggerelasticachesequenceresolvelengthpluginredirectpathminimalcompilerjsonindicatorincludesES2021qstakeSymbol.toStringTagSetextralanguageartconcatstreampatchspeedES2015sameValueZeropreprocessorassertionmulti-packagekoreanspinnerstapermcensorArrayBuffer.prototype.slicesortInt32Arrayhttpes5asyncmruwaf[[Prototype]]warningefficientreduxsetterECMAScript 2019randomjasmineawesomesauceString.prototype.matchAlllazycore-jscircularloadbalancingWeakSetvalidatetoobjectfilterforEaches8replayInt8ArraytestingintrinsicopenvestObject.entriesansishrinkwrapmatchAllUnderscoreprivate datajestdataviewoffsettostringtagbluebirdmonoreporfc4122regexendpoint256command-linechannelinternal slottypemakewalkcompareclassespipemobilerdstextES5concurrencyArray.prototype.containsframeworkreadablestreamclientrmdir@@toStringTagtermwidthreadablesuperstructtrimObjectpositiveES2019buffertypesspeckeysswfReflect.getPrototypeOfpostcss-pluginMicrosoftcoreArray.prototype.includesinputECMAScript 2015visualshimlimitflatMapasciiremovejsonpathworkflowfile systemESnextsnsTypeScriptfullsearcharraybufferthrottlemimetypesregular expressionnativeequalitypromisesscheme-validationidleAsyncIteratoriteratorchineseURLponyfilldescriptionObject.keysinvariantimmutabletypaniongenericsglacierutilitiestimesortedshebangmkdirsbundlingcharactercollection.es6functionimportformatcryptArray.prototype.flatMap_.extendvariablesenumerablestringifyES2023JSON-Schemafigletwhatwgsetes-shimsnameentriesinternalthroatzodcolorloadingserializebrowsereslintdependency manageremrwalkingclassnameimportexporttsargvisConcatSpreadablewaitavajQueryECMAScript 2016workerquerystringcryptofunctionscall-bindpicomatchebsfast-copyconsoletddtypescriptSymbolemojiBigInt64Arrayfindupdeepeast-asian-widtheveryCSSarrayswritablestarterwordwrapconnectschemeArray.prototype.findLastreal-timeautoscalingcall-boundTypeBoxassertspropertiesdependenciesparentexecapolloprivatevaluestrimEndfsform-validationterminalfull-widthkarmaflattenttysideUint16ArraycacheArray.prototype.filterfast-clonelook-upcharacterslimitedinstallpolyfillnumberjwtflagReactiveExtensionssomebyteLengthRegExp.prototype.flagsenvmapreduceconfigparentsviewpackage manager-0optimizerutilES2022objectargparseArray.prototype.flatassertcallbound$.extendescaperoute53react-testing-libraryparseescomputed-typesquerytslibdeep-copydomprefixisconfigurablefetches6packageoptiontoStringTagwatchingstreamslrutelephonebannermomentlintnameslesscssstyleguideECMAScript 2020watcherArraygetintrinsicgetoptvalueObject.getPrototypeOffoldermetadatapasswordkinesisarraybrowserslistbreakl10nduplexsymbolswritenodeiereducefunctionaldynamodblookmapmimedropajvcode pointsYAMLtoolschromeless compilerconsumepackage.jsonsharedarraybufferuuidfastregexpsimpledboutputcsstypeof0datastructureECMAScript 7byteOffsetrouteES2017callbackreadchromiumdefinegetPrototypeOftypedphoneECMAScript 2018HyBiownECMAScript 2021prototypepreserve-symlinkssqsES8css lessloggingcoerciblestoragegatewayFloat32Arraybatcha11yrequestpropertygetteriterateStyleSheetshames-shim APIelbformsiamaccessorboundmkdirp__proto__optimistweakmapstringifiermime-dbStreamsdescriptorjsdomeslintplugintc39mixinshaslistenersECMAScript 2017ArrayBuffer#slicenested cssbuffersstableexpressspinnermoduleObject.istypedarrayshigher-orderxhrcjkPromisewhichpredictablewrapemitmodulescolourstylinglockfiletrimLeftdiffgloblinkiterationinferencerateObservablesdeep-clonees2017cloudtrailMapargsmiddlewaresafeArray.prototype.flattenfullwidthomitsymlinks.envFloat64Arrayfromcodesunicodeyupcopyinclass-validatorFunction.prototype.namehookformes2018weaksetqueuedotenvjapanesereducerBigUint64ArrayuninstallObject.fromEntrieses7findLastdeepcloneapiutilitynpm

Readme

Human IDs

A library to generate human-readable IDs.

Description

Human IDs is a JavaScript library that allows you to generate human-readable IDs. The IDs consist of a combination of adjectives, colors, nouns, and numbers, creating unique and memorable identifiers.

Supports English and Spanish

Output example

bubbly-beige-fire-38
breezy-teal-faith-870
silly-indigo-imagination-440
genuine-turquoise-light-718
bubbly-purple-pen-450
genuine-silver-magic-935
delightful-brown-planet-642
cozy-orange-boat-449
excelente-morado-creatividad-829
energetico-oliva-libertad-765

Installation

To use Human IDs in your project, you can install it via npm:

npm install @odczynflnpm/laudantium-vitae-saepe

Usage example

import humanId from '@odczynflnpm/laudantium-vitae-saepe'

//If using a custom dictionary
const customDictionary = {
  adjectives: {
    awesome: 'awesome',
    amazing: 'amazing',
    // ...
  },
  colors: {
    red: 'red',
    blue: 'blue',
    // ...
  },
  nouns: {
    cat: 'cat',
    dog: 'dog',
    // ...
  },
};

// Initialize the settings object (these are the defaults)
const settings = {
  lang: 'en',
  adjective: true,
  color: true,
  noun: true,
  randomOrder: false,
  separator: '-',
  asObject: false,
  semantics: {
    es: ['noun', 'color', 'adjective', 'number'],
    en: ['adjective', 'color', 'noun', 'number'],
  },
  number: {
    min: 0,
    max: 999,
    sets: 1,
    completeWithZeros: false,
  },
};

// Generate an ID using the function
console.log(humanId())

Configuration

The settings object allows you to customize the ID generation process. The available options are:

userSettings (optional): An object containing various options to customize the generated ID. It includes the following properties:
    lang (string): The language for the ID generation. You can specify the language code (e.g., 'en' for English, 'es' for Spanish).
    adjective (boolean): Include an adjective component in the generated ID. (Default: true)
    color (boolean): Include a color component in the generated ID. (Default: true)
    noun (boolean): Include a noun component in the generated ID. (Default: true)
    randomOrder (boolean): Randomize the order of ID components. (Default: false)
    separator (string): The separator used to join the ID components. (Default: '-')
    asObject (boolean): Return the ID as an object instead of a string. (Default: false)
    semantics (object|null): An object specifying the order of components based on language. For example, you can set the order for Spanish using "es": ['noun', 'color', 'adjective', 'number'].
    number (object): An object containing settings for the number component:
        min (number): The minimum value for the number component. (Default: 0)
        max (number): The maximum value for the number component. (Default: 999)
        completeWithZeros (boolean): Pad the number with leading zeros to match the maximum length. (Default: false)
    dictionary (object): An object containing custom dictionaries for adjectives, colors, and nouns:
        adjectives (object): A dictionary of adjectives for different languages.
        colors (object): A dictionary of colors for different languages.
        nouns (object): A dictionary of nouns for different languages.

Return Value

The generateId function returns a unique identifier as a string by default. If the asObject option is set to true, the function returns an object containing the individual components of the ID.

Examples

Generate an ID with default settings:


const id = generateId({ lang: 'en' });
console.log(id); // Example output: "green-house-123"

Generate an ID as an object:


const idObject = generateId({ lang: 'es', asObject: true });
console.log(idObject);
// Example output:
// {
//   adjective: 'casa',
//   color: 'verde',
//   noun: 'montaña',
//   number: '0123'
// }

Test Results

While the generated IDs strive for uniqueness, it's important to note that absolute uniqueness cannot be guaranteed, especially with a finite set of words and numbers. During the uniqueness test, the generator produced 999,722 unique IDs out of the expected 1,000,000. This means that a small number of duplicates may occur in practice. License

This project is licensed under the ISC License.

Feel free to modify the README.md file to fit your project's specific details and requirements.

Contributing

Contributions and bug reports are welcome! Feel free to open an issue or submit a pull request on the GitHub repository. Please ensure that your code follows the project's coding standards and includes appropriate test coverage.

License

This project is licensed under the MIT License.