Skip to content

bendrucker/firebase-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Parse and format Firebase URLs

Resources

License

Stars

Watchers

Forks

Packages

No packages published