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

blcdn

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blcdn

Bloglovin CDN client

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Bloglovin' CDN client

Bloglovin' CDN client for generated signed urls for use with blovcdn.com.

Usage

var lib = {
  Cdn: require('blcdn')
};

var cdn = new lib.Cdn({
  salt: 'b73ec4880853451fb28dea450abcb520', // Yes, totally fake & made up
  hosts: [
    "cdn1.blovcdn.com",
    "cdn2.blovcdn.com",
    "cdn3.blovcdn.com"
  ]
});

// Generate a signed cdn url in the format 's' for the image.
var cdnUrl = cdn.imageUrl('http://example.com/some-image.jpg', 's');

Tests

Tests are run through npm test. The raw test URLs (URLs that are generated with the PHP lib that we need to conform to) are stored in test/cdn.json. If this file is modified the test cases must be updated through running ./bin/update-test-cases. This will generate a random salt and update test/cases.json with the URLs signed with the new salt. This is necessary for running the tests without knowing the real salt.

To run the tests with the proper salt you need to export the salt as the environment variable CDN_SALT, like so:

export CDN_SALT="b73ec4880853451fb28dea450abcb520"

The salt is expected to be a hex encoded string.

Keywords

FAQs

Package last updated on 19 Jan 2015

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