firebase-url

1.0.1 • Public • Published

firebase-url Build Status

Parse and format Firebase URLs

Install

$ npm install --save firebase-url

Usage

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'
})

API

parse(uri) -> uriObject

Parses a URL, returning a parsed URL object with the properties:

  • endpoint (string)
  • path (string)
  • isRoot (boolean)
  • uri (string) normalized uri
uri

Required
Type: string

A Firebase URL, either an endpoint alone or an endpoint plus a path.

format(urlObject) -> string

uriObject

Required
Type: object

Formats a uriObject back into a uri string. The uriObject must have endpoint and path properties. All others are ignored.

License

MIT © Ben Drucker

Package Sidebar

Install

npm i firebase-url

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker