location-slugger
v0.0.1
Published
Airbnb style location slugger / unslugger
Downloads
2
Readme
A simple library that converts locations, typically provided by something like the Google Place Autocomplete API (or Geocomplete) into URL friendly slugs - in an AirBnb style
Shoreditch Highstreet, London ** becomes **Shoreditch-High-Street--London
##Usage##
Slug
var slugger = require('location-slugger'),
var result = slugger.slug("Camberley, Surrey");
//returns 'Camberley--Surrey'
Un-Slug
var slugger = require('location-slugger'),
var result = slugger.slug("Camberley--Surrey");
//returns 'Camberley, Surrey'