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

angular-link-header-parser

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

angular-link-header-parser

AngularJS factory that parse Link header and return a JSON object.

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
33
decreased by-15.38%
Maintainers
1
Weekly downloads
 
Created
Source

AngularJS factory that parse Link header and return a JSON object.

TODO

  • unit testing
  • more code documentations
  • add examples

License

Released under the terms of the MIT License.

Contributing

If you want to contribute, please read this small guide.

Changelog

You ask yourself what has changed? Please read the changelog.

Installation

bower install [--save] angular-link-header-parser

Usage

Include angular-link-header-parser.js or minified version angular-link-header-parser.min.js.

<script src="path/to/vendors/angular-link-header-parser/release/angular-link-header-parser.js"></script>
<!-- OR -->
<script src="path/to/vendors/angular-link-header-parser/release/angular-link-header-parser.min.js"></script>

Add the module ig.linkHeaderParser as a dependency to your app module.

angular.module("app", [ "ig.linkHeaderParser" ]);

Then when needed inject linkHeaderParser as a dependency.

angular
  .module("app")
  .controller("Controller", Controller);

Controller.$inject = [ "linkHeaderParser" ];

function Controller(linkHeaderParser) {
  var vm = this;
  
  var linkHeaderText = '<http://localhost:28786/dev/certifications?page=1&limit=100>; rel="first", <http://localhost:28786/dev/certifications?page=1&limit=100>; rel="last", <http://localhost:28786/dev/certifications?page=1&limit=100>; rel="next", <http://localhost:28786/dev/certifications?page=1&limit=100>; rel="prev"';
  
  var json = linkHeaderParser.parse(linkHeaderText);
  
  console.log(json);
}

You will receive a JSON object like this :

{
  "first": {
    "limit": 100,
    "page": 1,
    "url": "http://localhost:28786/dev/certifications?page=1&limit=100"
  },
  "last": {
    "limit": 100,
    "page": 1,
    "url": "http://localhost:28786/dev/certifications?page=1&limit=100"
  },
  "next": {
    "limit": 100,
    "page": 1,
    "url": "http://localhost:28786/dev/certifications?page=1&limit=100"
  },
  "prev": {
    "limit": 100,
    "page": 1,
    "url": "http://localhost:28786/dev/certifications?page=1&limit=100"
  },
}

FAQs

Package last updated on 06 Mar 2018

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