1.0.12 • Published 7 years ago

url-generator v1.0.12

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

URL Generator

Build Status

A simple JavaScript url generator, takes an array of parameters and returns all possible permutations of the url as an array

Installation

For use with node you can either use yarn or npm

yarn install url-generator --save

Or for use in the browser you can intsall from bower

bower install url-generator --save

Useage

create

urlGenerator.create({
  url: 'http://www.google.com', 
  params: [
    {
      key: 'utm_campaign',
      value: [
        'google',
        'twitter',
        'facebook'
      ]
    },
    {
      key: 'utm_term',
      value: 'something'
    }
  ]
}).then(result => {
  console.log(result)
}).catch(error => {
  console.log(error)
})

search

urlGenerator.search([
  {
    key: 'utm_campaign',
    value: [
      'google',
      'twitter',
      'facebook'
    ]
  },
  {
    key: 'utm_term',
    value: 'something'
  }
]).then(result => {
  console.log(result)
}).catch(error => {
  console.log(error)
})

slug

urlGenerator.slug('Hello World')

parseUrl

urlGenerator.parseUrl('http://www.google.com')
1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.4

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago