How to use url-slug - 3 common examples

To help you get started, we’ve selected a few url-slug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github modularcode / modular-admin-react / src / client / _state / items / selectors.js View on Github external
export const getPlaceUrl = (place) => {
  if (!place) {
    return "";
  }

  const {
    placeId,
    name
  } = place;

  const slug = urlSlug(name);

  return `/places/${placeId}-${slug}`;
};

url-slug

Slug generator with less than 1 KB and no dependencies, RFC 3986 compliant

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular url-slug functions