parameterize-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Parameterize.js

This is a fork of node-parameterize by Fırat Yalavuz, rewritten in TypeScript.

This repository adds node.js and npm support for parameterize which is originally used in Ruby on Rails. It replaces special characters in a string so that it may be used as part of a 'pretty' URL.

parameterize.js is a port of django admin urlify.js

Installing

npm install parameterize.js

Supports

  • Turkish
  • Azerbaijani
  • Serbian
  • Greek
  • Georgian
  • Russian
  • Ukranian
  • Czech
  • Polish
  • Romanian
  • Latvanian
  • Lithuanian
  • Arabic
  • Latin special chars

Usage

import parameterize from 'parameterize.js';

// outputs
// parameterized-url-with-special-characters-ocisc
parameterize('parameterized url with special characters, öçıŞÇ');

// optional length limit
// outputs
// this-is-a-l
parameterize('this is a long text', {maxLength: 10});

// you can change separator character
// outputs
// this_is_a_l
parameterize('this is a long text', {maxLength: 10, separator: '_'});

Readme

Keywords

none

Package Sidebar

Install

npm i parameterize-js

Weekly Downloads

934

Version

1.0.0

License

MIT

Unpacked Size

14 kB

Total Files

15

Last publish

Collaborators

  • marvinscharle