@francomelandri/url-builder
url builder
Last updated a year ago by francomelandri .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @francomelandri/url-builder 
SYNC missed versions from official npm registry.

url-builder

Build Status NPM version License: MIT

Small node package to build an URL starting form a template like this:

{{protocol}}://{{host}}/{{isocode}}/{{path}}

How to use:

    test('should return url with query string parameter', () => {
        let url = sut()
            .withHost('www.example.com')
            .withIso('it')
            .withPath('/login')
            .withQueryParameter('returnUrl', '/')
            .build();

        expect(url).toBe('https://www.example.com/it/login?returnUrl=/');
    });

To run the test:

> npm test

Current Tags

  • 1.0.2                                ...           latest (a year ago)

3 Versions

  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 3
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |