kb-burly
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Burly
Coverage Travis npm version

A simple Typescript URL builder

Installation


npm i --save kb-burly

Usage

Edit burly-examples-t6lzw

Basic:

const burly = Burly("https://api.com/find")
              .addParam("id", 1234)
              .get; // = https://api.com/find?id=1234

Nested query:

const object = {
  yes: 'no',
  maybe: '/test/',
  bad: null
}

const burly = Burly('http://test.com')
              .addQuery('where', object)
              .get; // = http://test.com?where=yes%3D%27no%27%26maybe%3D%27%2Ftest%2F%27

Null parameter:

const burly = Burly("http://bad-param.blog")
              .addParam('bad', null)
              .get; // = http://bad-param.blog

Reference:

new Burly([baseURL])

Credits

Based heavily on url-assembler by Florent Jaby

/kb-burly/

    Package Sidebar

    Install

    npm i kb-burly

    Weekly Downloads

    1

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    5

    Last publish

    Collaborators

    • 128keaton