All Projects → fyalavuz → node-parameterize

fyalavuz / node-parameterize

Licence: MIT License
parameterize.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-parameterize

http
Aplus Framework HTTP Library
Stars: ✭ 113 (+213.89%)
Mutual labels:  url
Re-skinning url splitter
Divide / Split your WordPress Blog visitors into 4 links by using Re-skinning URL splitter
Stars: ✭ 73 (+102.78%)
Mutual labels:  url
URL-Magnet-Cloud-Uploader-Heroku
Aria 2 Rclone Remote URL /magnet Clouds upload via HEROKU
Stars: ✭ 99 (+175%)
Mutual labels:  url
reachable-urls
Check URLs are reachable in text 🕵️
Stars: ✭ 29 (-19.44%)
Mutual labels:  url
utils.js
👷 🔧 zero dependencies vanilla JavaScript utils.
Stars: ✭ 14 (-61.11%)
Mutual labels:  url
micell
A collection of functions for front-end development
Stars: ✭ 16 (-55.56%)
Mutual labels:  url
seourls
phpBB Extension: URL rewriting for phpBB forums
Stars: ✭ 44 (+22.22%)
Mutual labels:  url
Slugify
Simple Slug / Clean URL generator helper for Microsoft .NET framework / .NET Standard.
Stars: ✭ 53 (+47.22%)
Mutual labels:  url
urlshortener-rs
A very-very simple url shortener for Rust
Stars: ✭ 34 (-5.56%)
Mutual labels:  url
quill-magic-url
Automatically convert URLs to links in Quill
Stars: ✭ 86 (+138.89%)
Mutual labels:  url
fbvideos
🔗 Easily extract downloadable link of publicly available videos on facebook.
Stars: ✭ 28 (-22.22%)
Mutual labels:  url
ocaml-uri
RFC3986 URI parsing library for OCaml
Stars: ✭ 85 (+136.11%)
Mutual labels:  url
UrlCombine
C# util for combining Url paths. Works similarly to Path.Combine.
Stars: ✭ 23 (-36.11%)
Mutual labels:  url
Limg
An image hosting service powered by Laravel
Stars: ✭ 41 (+13.89%)
Mutual labels:  url
git-repo-name
Get the repository name from the git remote origin URL
Stars: ✭ 21 (-41.67%)
Mutual labels:  url
cyber-matrix-ai
Collection of cyber security and "AI" relevant topics
Stars: ✭ 69 (+91.67%)
Mutual labels:  url
URLQueryItemEncoder
A Swift Encoder for encoding any Encodable value into an array of URLQueryItem.
Stars: ✭ 60 (+66.67%)
Mutual labels:  url
postcss-inline-base64
PostCSS plugin used to replace value inside of url function to base64
Stars: ✭ 23 (-36.11%)
Mutual labels:  url
doi2bib
📝 Easily convert Digital Object Identifier (DOI) and Uniform Resource Locator (URL) to BibTeX and DOI to plain text.
Stars: ✭ 28 (-22.22%)
Mutual labels:  url
wumpfetch
🚀🔗 A modern, lightweight, fast and easy to use Node.js HTTP client
Stars: ✭ 20 (-44.44%)
Mutual labels:  url

node-parameterize

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

Supports

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

Require

var parameterize = require('parameterize');

Using

parameterize('parameterized url with special characters, öçıŞÇ');
// outputs
// parameterized-url-with-special-characters-ocisc
// using optional length limit
parameterize('this is a long text', 10);
// outputs
// this-is-a-l
// you can change delimiter character
parameterize('this is a long text', 10, '_');
// outputs
// this_is_a_l

Using in express.js 3 view files as view helper

You can implement it as in the example just below in your app.js file so that you can use it in all views. Note that it should be before the line 'app.use(app.router)'.

app.configure

  app.use(function(req, res, next) {
    res.locals.parameterize = parameterize
    next();
  });
  
  app.use(app.router);

using with jade template engine

index.jade

#{parameterize('parameterized url with special characters, öçıŞÇ')}
// output:
// parameterized-url-with-special-characters-ocisc

using with ejs template engine

index.ejs

<% parameterize('parameterized url with special characters, öçıŞÇ') %>
// parameterized-url-with-special-characters-ocisc
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].