Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@nuskin/bynder-dat
Advanced tools
This library hosts a collection of wrapper functions for bynder's DAT API.
This library hosts a collection of wrapper functions for bynder's DAT API. The library also builds in both cjs and esm formats. ESM for better treeshaking support. CJS for node/backend apps.
Usng npm:
npm add @nuskin/bynder-dat
Usng yarn:
yarn add @nuskin/bynder-dat
const { useFormat, transformFill } = require('@nuskin/bynder-dat');
// apply format
const url = useFormat('http://foo.baz.bar', 'webp');
console.log(url); // http://foo.baz.bar?format=webp
// transform
const url = transformFill('http://foo.baz.bar', { height: 100, width: 100 });
console.log(url); // http://foo.baz.bar?io=transform:fill,height:100,width:100;
// combination
const url = transformFill(useFormat('http://foo.baz.bar', 'webp'), { height: 100, width: 100 });
console.log(url); // http://foo.baz.bar?format=webp&io=transform:fill,height:100,width:100;
// inter-changeable
const url = useFormat(transformFill('http://foo.baz.bar', { height: 100, width: 100 }), 'webp');
console.log(url); // http://foo.baz.bar?io=transform:fill,height:100,width:100&format=webp;
import { useFormat, transformFill } from '@nuskin/bynder-dat';
// The same examples above can be performed.
Using webp already reduces file size by alot
import { useFormat } from '@nuskin/bynder-dat';
// retrieve the DAT derivative - transformBaseUrl
const { transformBaseUrl } = bynderImageObject.derivatives;
const webpImage = useFormat(transformBaseUrl, 'webp');
You know the dimensions of the image you need to render.
import { useFormat, transformFill } from '@nuskin/bynder-dat';
// retrieve the DAT derivative - transformBaseUrl
const { transformBaseUrl } = bynderImageObject.derivatives;
const webpThumbnailImage = transformFill(useFormat(transformBaseUrl, 'webp'), { height: 100, width: 100 });
You know the dimensions of the image you need to render.
import { useFormat, transformFill } from '@nuskin/bynder-dat';
// retrieve the DAT derivative - transformBaseUrl
const sourcesetMap = [
{ width: 320, height: 200 },
{ width: 800, height: 400 }
];
const { transformBaseUrl } = bynderImageObject.derivatives;
const imageSourceSet = sourcesetMap
.map((dimensions) => `${transformFill(useFormat(transformBaseUrl, 'webp'), dimensions)} ${dimensions.width}w`)
.join(',');
// "media.nuskin.com/transform/foo?format=webp&transform:fill,width:320,height:200 320w, media.nuskin.com/transform/foo?format=webp&transform:fill,width:800,height:400 800w"
FAQs
This library hosts a collection of wrapper functions for bynder's DAT API.
The npm package @nuskin/bynder-dat receives a total of 3 weekly downloads. As such, @nuskin/bynder-dat popularity was classified as not popular.
We found that @nuskin/bynder-dat demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.