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

url-template

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-template

A URI template implementation (RFC 6570 compliant)

  • 3.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.2M
decreased by-11.63%
Maintainers
2
Weekly downloads
 
Created

What is url-template?

The url-template npm package is a utility for expanding URLs that follow the URI Template specification as per RFC 6570. This package allows developers to programmatically build URLs with variable substitutions in a template format, making it easier to handle complex URL generation scenarios.

What are url-template's main functionalities?

URL Expansion

This feature allows for the expansion of URL templates with variables. The template is defined with placeholders, and the expand method replaces these placeholders with actual values provided in an object.

var urlTemplate = require('url-template');
var template = urlTemplate.parse('/{section}/{topic}{?orderby,direction}');
var url = template.expand({ section: 'blog', topic: 'npm-packages', orderby: 'date', direction: 'asc' });
console.log(url); // Outputs: /blog/npm-packages?orderby=date&direction=asc

Other packages similar to url-template

Keywords

FAQs

Package last updated on 13 Dec 2023

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