Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uri-template-lite

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uri-template-lite

URI Template [RFC 6570] implementation in less than 1kb

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
decreased by-81.8%
Maintainers
1
Weekly downloads
 
Created
Source
@version    0.1.2
@date       2014-01-20
@stability  2 - Unstable

URI Template – Build Coverage

URI Template RFC 6570 implementation in less than 1kb.

Installation

To use it in the browser, include uri-template-min.js in your site

<script src=uri-template-min.js></script>

In node.js: npm install uri-template-lite

var URI = require("uri-template-lite").URI

Usage

var data = {"domain":"example.com", "user":"fred", "query":"mycelium"}
URI.expand("http://{domain}/~{user}/foo{?query,number}", data)
// http://example.com/~fred/foo?query=mycelium

About error handling

This implementation tries to do a best effort template expansion and leaves erroneous expressions in the returned URI instead of throwing errors. So for example, the incorrect expression {unclosed will return {unclosed as output.

Browser Support

browser support

  • For IE6-9 it requires browser-upgrade-lite module or other ES5 polyfill.

Licence

Copyright (c) 2014 Lauri Rooden <lauri@rooden.ee>
The MIT License

Keywords

FAQs

Package last updated on 20 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc