New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

web-linking

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-linking

module for working with web links as described in rfc2616

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

web-linking

Module for working with web links as described in rfc2616

var linking = require('../lib/main.js');
var httpheaderlinking = linking.httpheader;

var str = '<http://example.com/TheBook/chapter2>; rel="previous"; title="previous chapter"'

//Parse from string into json
var parsed = httpheaderlinking.parse(str);    	

//Stringify from json into string
var str2   = httpheaderlinking.stringify(parsed);   

//Now str = str2

//Parse from a http request header into json
function(req,res){
	var parsed = httpheaderlinking.parseRequest(req);    	
}

//Set from json into a http request header
function(req,res){
	 var link = [
         {
            href: 'http://example.com/TheBook/chapter2',
            rel: 'previous',
            title: 'previous chapter'
         }
     ];
     httpheaderlinking.setToResponse(res, link);    	
}

Keywords

node

FAQs

Package last updated on 15 Sep 2013

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