1.0.2 • Published 5 years ago

@francomelandri/url-builder v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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