Parse and format Firebase URLs
$ npm install --save firebase-url
var firebaseUrl = require('firebase-url')
// inverses
firebaseUrl.parse('https://your-endpoint.firebaseio.com/foo/bar')
firebaseUrl.format({
endpoint: 'https://your-endpoint.firebaseio.com',
path: '/foo/bar'
})
Parses a URL, returning a parsed URL object with the properties:
-
endpoint
(string
) -
path
(string
) -
isRoot
(boolean
) -
uri
(string
) normalizeduri
Required
Type: string
A Firebase URL, either an endpoint alone or an endpoint plus a path.
Required
Type: object
Formats a uriObject
back into a uri
string. The uriObject
must have endpoint
and path
properties. All others are ignored.
MIT © Ben Drucker