New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

slugme

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

slugme

Convert a string into a string good looking for URLs.

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
103
5.1%
Maintainers
1
Weekly downloads
 
Created
Source

Slugme

NPM Version travis xo

This is a simple javascript function that returns slugified string. The slugification is useful for URL build from accentuated strings.

It replaces accentuated chars to non-accentuated and spaces by the minus sign. All other chars (non-alphanumeric) are removed or replaced.

Work both in Node & browser environment.

Install

npm i slugme -S

Usage

const slugme = require('slugme');
const result = slugme('Être en été est à mi-chemin de noël');

console.log(result);

//=> etre-en-ete-est-a-mi-chemin-de-noel

Browser

Example:


<input value="Être en été est à mi-chemin de noël" id="slug-this" onkeyup="slugLive('slug-this','slugme');" />
Slug : «&nbsp;<span id="slugme"></span>&nbsp;»

<script src="../index.js"></script>

<script type="text/javascript">

const slugLive = function (input,output) {
  const valueIn = document.getElementById(input).value;
  var idOut = document.getElementById(output);
  idOut.innerHTML = slugme(valueIn);
}

slugLive('slug-this','slugme');

</script>


Misc

  • Golang version

Licence

MIT

Keywords

slug

FAQs

Package last updated on 14 Nov 2017

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