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

asset-hash

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asset-hash - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

10

lib/index.cjs.js

@@ -1,2 +0,2 @@

/*! asset-hash v1.0.4 by Sebastian Werner <s.werner@sebastian-software.de> */
/*! asset-hash v1.0.5 by Sebastian Werner <s.werner@sebastian-software.de> */
'use strict';

@@ -8,3 +8,3 @@

require('nodent-runtime');
require('nodent-runtime/promise');
var xxhash = require('xxhash');

@@ -58,3 +58,3 @@ var fs = require('fs');

try {
var hasher = hash === "xxhash" ? new xxhash.Stream(0xcafebabe, "buffer") : crypto.createHash(hash);
const hasher = hash === "xxhash" ? new xxhash.Stream(0xcafebabe, "buffer") : crypto.createHash(hash);

@@ -71,3 +71,3 @@ fs.createReadStream(fileName).pipe(hasher).on("finish", () => {

function getHashedName(fileName, hash = "xxhash", base = 52, max = 10) {
return new Promise(function ($return, $error) {
return new Promise(($return, $error) => {
var hashed, ext;

@@ -81,3 +81,3 @@ return getHash(fileName).then(function ($await_2) {

}.$asyncbind(this, $error), $error);
}.$asyncbind(this));
});
}

@@ -84,0 +84,0 @@

@@ -1,3 +0,3 @@

/*! asset-hash v1.0.4 by Sebastian Werner <s.werner@sebastian-software.de> */
import 'nodent-runtime';
/*! asset-hash v1.0.5 by Sebastian Werner <s.werner@sebastian-software.de> */
import 'nodent-runtime/promise';
import { Stream } from 'xxhash';

@@ -51,3 +51,3 @@ import { createReadStream } from 'fs';

try {
var hasher = hash === "xxhash" ? new Stream(0xcafebabe, "buffer") : createHash(hash);
const hasher = hash === "xxhash" ? new Stream(0xcafebabe, "buffer") : createHash(hash);

@@ -64,3 +64,3 @@ createReadStream(fileName).pipe(hasher).on("finish", () => {

function getHashedName(fileName, hash = "xxhash", base = 52, max = 10) {
return new Promise(function ($return, $error) {
return new Promise(($return, $error) => {
var hashed, ext;

@@ -74,3 +74,3 @@ return getHash(fileName).then(function ($await_2) {

}.$asyncbind(this, $error), $error);
}.$asyncbind(this));
});
}

@@ -77,0 +77,0 @@

{
"name": "asset-hash",
"version": "1.0.4",
"version": "1.0.5",
"description": "Very fast asset hashing function for using e.g. during front-end deployments.",

@@ -8,2 +8,5 @@ "main": "lib/index.cjs.js",

"scripts": {
"lint:js": "eslint --ignore-path .gitignore .",
"fix:js": "eslint --ignore-path .gitignore --fix .",
"format:js": "prettier --ignore-path .gitignore --write '**/*.{js,mjs}' && npm run fix:js",
"release": "git push && release-it --github.release --npm.publish --non-interactive",

@@ -13,3 +16,3 @@ "release:minor": "git push && release-it --github.release --npm.publish --non-interactive --increment minor",

"prepare": "preppy",
"test": "jest"
"test": "jest --coverage"
},

@@ -53,6 +56,6 @@ "keywords": [

"devDependencies": {
"babel-preset-edge": "^1.4.1",
"eslint-config-readable": "^1.4.1",
"babel-preset-edge": "^1.6.0",
"eslint-config-readable": "^1.10.2",
"jest": "^22.1.4",
"preppy": "^3.2.2",
"preppy": "^3.3.1",
"prettier": "^1.10.2",

@@ -59,0 +62,0 @@ "release-it": "^6.1.1"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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