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

asset-resolver

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asset-resolver - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

11

changelog.md
1.0.1 / 2018-03-14
v1.0.2 / 2018-05-17
==================
* updated yarn.lock
* Chore: update fs-extra to 6.0.1 (#213)
* Add basic auth option
v1.0.1 / 2018-03-14
==================
* Don't break on file permission error
1.0.0 / 2017-12-17
v1.0.0 / 2017-12-17
==================

@@ -9,0 +16,0 @@

@@ -36,2 +36,10 @@ 'use strict';

/**
* Token generated by concatenating username and password with `:` character within a base64 encoded string.
* @param {String} user User identifier.
* @param {String} pass Password.
* @returns {String} Base64 encoded authentication token.
*/
const token = (user, pass) => Buffer.from([user, pass].join(':')).toString('base64');
/**
* Get external resource

@@ -41,7 +49,13 @@ * @param {string} resource

*/
function requestAsync(resource) {
function requestAsync(resource, opts = {}) {
const settings = {
followRedirect: true,
encoding: null
encoding: null,
rejectUnauthorized: false
};
if (opts.user && opts.pass) {
settings.headers = {Authorization: 'Basic ' + token(opts.user, opts.pass)};
}
return new Bluebird((resolve, reject) => {

@@ -48,0 +62,0 @@ // Handle protocol-relative urls

5

package.json
{
"name": "asset-resolver",
"version": "1.0.1",
"version": "1.0.2",
"description": "Find an asset in a set of locations",

@@ -33,4 +33,5 @@ "license": "MIT",

"filesize": "^3.5.11",
"fs-extra": "^5.0.0",
"fs-extra": "^6.0.1",
"globby": "^7.1.1",
"got": "^8.3.1",
"hash": "0.2.0",

@@ -37,0 +38,0 @@ "lodash": "4.17.4",

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