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

@joplin/fork-uslug

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@joplin/fork-uslug

A permissive slug generator that works with unicode.

  • 1.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
832
decreased by-27.15%
Maintainers
3
Weekly downloads
 
Created
Source

Uslug.js


Modified for Joplin:

  • Added support for emojis - "🐶🐶🐶🐱" => "dogdogdogcat"

Permissive slug generator that works with unicode. We keep only characters from the categories Letter, Number and Separator (see Unicode Categories) and the common CJK Unified Ideographs as defined in the version 6.0.0 of the Unicode specification.

Inspired by unicode-slugify. Note that this slug generator is different from node-slug which focus on translating unicode characters to english or latin equivalent.

Quick Examples

uslug('Быстрее и лучше!') // 'быстрее-и-лучше'
uslug('汉语/漢語') // '汉语漢語'

uslug('Y U NO', { lower: false })) // 'Y-U-NO'
uslug('Y U NO', { spaces: true })) // 'y u no'
uslug('Y-U|NO', { allowedChars: '|' })) // 'yu|no'

Installation

npm install uslug

Options

uslug(string, options)

Generate a slug for the string passed.

Arguments

  • string - The string you want to slugify.
  • options - An optional object that can contain:
    • allowedChars: a String of chars that you want to be whitelisted. Default: '-_~'.
    • lower: a Boolean to force to lower case the slug. Default: true.
    • spaces: a Boolean to allow spaces. Default: false.

License

This project is distributed under the MIT License. See LICENSE file for more information.

FAQs

Package last updated on 02 Jul 2024

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