Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
asset-helper
Advanced tools
A simple and easy to use module to manage asset path and versions.
Install the module through NPM:
$ npm install asset-helper --save
Requires Node 4 or above
Include the module and create a new AssetHelper
object:
const AssetHelper = require('asset-helper');
// Will output style/main.css
const assetHelper = new AssetHelper();
console.log(assetHelper.path('style/main.css'));
// Will output http://www.foo.com/style/main.css
const assetHelperWithBaseUrl = new AssetHelper({
baseUrl: 'http://www.foo.com/'
});
console.log(assetHelperWithBaseUrl.path('style/main.css'));
// Will output /style/main.css?v=3094302hdhsd9fu9023
const assetHelperWithHash = new AssetHelper({
baseDirectory: __dirname + '/../public/',
appendHash: true
});
console.log(assetHelperWithHash.path('style/main.css'));
// You can override configuration params on individual calls:
// Will output /style/main.css
console.log(assetHelperWithHash.path('style/main.css', { appendHash: false }));
It will prepend a base url to your asset. Useful in case you use a CDN and want the local path when on development environment.
Needed for calculating the hash, it should point to your asset main directory.
It will append a querystring with a MD5 calculated on file content.
$ npm test
This module was originally written to be used with Receiptful and is used in a production environment currently. This will ensure that this module is well maintained, bug free and as up to date as possible.
Receiptful's developers will continue to make updates as often as required to have a consistently bug free platform, but we are happy to review any feature requests or issues and are accepting constructive pull requests.
FAQs
NodeJs Asset Helper
The npm package asset-helper receives a total of 0 weekly downloads. As such, asset-helper popularity was classified as not popular.
We found that asset-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.