Gathering detailed insights and metrics for limax
Gathering detailed insights and metrics for limax
Gathering detailed insights and metrics for limax
Gathering detailed insights and metrics for limax
npm install limax
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
587 Stars
76 Commits
50 Forks
8 Watching
1 Branches
11 Contributors
Updated on 25 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-32.7%
3,445
Compared to previous day
Last week
14.7%
24,450
Compared to previous week
Last month
-29.9%
102,429
Compared to previous month
Last year
71%
1,645,202
Compared to previous year
4
4
(Yet another) Node.js module to generate URL slugs, also known as clean URLs, user-friendly URLs and SEO-friendly URLs.
The difference?
This module extends the fantastic speakingurl module to include Romanisation of Chinese and Japanese scripts.
Give it a string of text in pretty much any major world language and it will convert it to valid characters, conforming to RFC3986, for use within the path element of a URL.
Currently supports, but not limited to, the following scripts:
If you already use either the
speakingurl or
slug modules,
you can probably swap in limax
without changing the logic in your code.
Oh, and limax
is the Latin word for slug.
npm install limax
1import slug from 'limax';
1const latin = slug('i ♥ latin'); // i-love-latin 2const cyrillic = slug('Я люблю русский'); // ya-lyublyu-russkij 3const pinyin = slug('我爱官话'); // wo3-ai4-guan1-hua4 4const romaji = slug('私は ひらがな が大好き'); // ha-hiragana-gaki
options:
replacement
: String to replace whitespace with, defaults to -
(provides API compatibility with the slug
module)separator
: String, equivalent to replacement
(provides API compatibility with the speakingurl
module)lang
: String, ISO 639-1 two-letter language code, defaults to auto-detected languagetone
: Boolean, add tone numbers to Pinyin transliteration of Chinese, defaults to true
separateNumbers
: Boolean, separate numbers that are within a word, defaults to false
separateApostrophes
: Boolean, separate apostrophes that are within a word, defaults to false
maintainCase
: Boolean, maintain the original string's casing, defaults to false
custom
:
{ '&': '#', '*': ' star ' }
1const strich = slug('Ich ♥ Deutsch', {lang: 'de'}); // ich-liebe-deutsch 2const unterstreichen1 = slug('Ich ♥ Deutsch', {lang: 'de', replacement: '_'}); // i_liebe_deutsch 3const unterstreichen2 = slug('Ich ♥ Deutsch', {lang: 'de', separator: '_'}); // i_liebe_deutsch 4const wuYin = slug('弄堂里的菜品赤醬', {tone: false}); // nong-tang-li-di-cai-pin-chi-jiang 5 6// separateNumbers example 7const numbersInWord = slug('hello2world'); // hello2world 8const numbersSeparated = slug('hello2world', { separateNumbers: true }); // hello-2-world 9 10// separateApostrophes example 11const apostrophesInWord = slug('j\'aime'); // jaime 12const apostrophesSeparated = slug('j\'aime', { separateApostrophes: true }); // j-aime 13 14// maintainCase example 15const caseNotMaintained = slug('HelloWorld'); // helloworld 16const caseMaintained = slug('HelloWorld', { maintainCase: true }); // HelloWorld 17 18// custom example 19const custom1 = slug('hello.world', { custom: ['.'] }); // hello.world 20const custom2 = slug('hello-*-world', { custom: { '*': 'asterisk' } }); // hello-asterisk-world
Provided to support backwards-compatibility with the slug
module.
1const underscore = slug('i ♥ unicode', '_'); // i_love_unicode
Run the unit tests with:
npm test
Pull requests with mappings and tests for further scripts and languages are more than welcome.
Copyright 2013 Lovell Fuller and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 6/30 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More