1.0.1 • Published 9 years ago

firebase-url v1.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
9 years ago

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

1.0.1

9 years ago

1.0.0

9 years ago