
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@garfish/loader
Advanced tools
@garfish/loader
import { Loader } from '@garfish/loader';
const loader = new Loader({
maxSize: 1024 * 1024 * 15, // default number is "1024 * 1024 * 15"
});
loader.hooks.usePlugin({
name: 'test-plugin1',
beforeLoad({ url, config }) {
// You can changed the request config
if (url.includes('xx')) {
url = url.replace('xx', '');
}
return { url, config };
},
loaded(data) {
const { result, value } = data;
data.n = 1;
return data;
},
});
loader.hooks.usePlugin({
name: 'test-plugin2',
loaded(data) {
console.log(data.n); // 1
// The "data.value" will be cached this time.
// So, you can transform the request result.
return data;
},
});
loader.load({scope: 'appName', url: 'https://xxx'}).then((result) => {
console.log(result); // 2
});
const loader = new Loader();
loader.clear('appName'); // Clear all cached resources under "appName"
loader.clear('appName', 'js'); // Clear all "js" cache resources under "appName"
loader.clearAll(); // Clear all cached resources
loader.clearAll('css'); // Clear all "css" cached resources
FAQs
loader module.
The npm package @garfish/loader receives a total of 687 weekly downloads. As such, @garfish/loader popularity was classified as not popular.
We found that @garfish/loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.