Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aurelle/idiomatic-slug

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aurelle/idiomatic-slug

Generate slugs made of an English adjective and noun.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

idiomatic-slug

Generates slugs made of an adjective and a noun.

Browser and NodeJS compatible.

Usage

import { generate } from '@aurelle/idiomatic-slug'

console.log(generate())
// angry-alarm

console.log(generate({ separator = ' ' }))
// angry alarm

It's also possible to generate a random adjective or noun separately:

import { noun, adjective } from '@aurelle/idiomatic-slug'

console.log(noun())
// alarm

console.log(adjective())
// angry

Concerns

Uniqueness

This package uses local wordlists that, when combined into an adjective-noun slug, make up for a total of 2,910,512 unique slugs. While this may seem huge you want to apply extra care if you rely on this slug as your only source of uniqueness (which I wouldn't recommend).

Memory footprint

To keep it simple and fast, the wordlists are loaded in memory as Javascripts arrays. As such, this has little impact on the general memory consumption. While this should not be that big of a deal, especially on systems that have the luxury of running NodeJS, that's worth noting.

FAQs

Package last updated on 10 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc