New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

available-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

available-slug

Find an available slug for given text

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

available-slug

Slugifies your string and makes sure it's returning a result that is available to register.

Install

$ npm install available-slug

Usage

var slug = require('available-slug')('/my-api/check-availability?check={slug}')

slug('yo wassup', function (error, result) {

  error
  // => undefined

  result
  // => yo-wassup

});

If your server returns false value for yo-wassup, then the first available from following options will be returned;

  • yo-wassup-new
  • yo-wassup-2014
  • yo-wassup-december
  • yo-wassup-{random 4 digits number here}

Your server needs to return parseable JSON, either;

false

or:

{ available: false }

Keywords

FAQs

Package last updated on 04 Dec 2014

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