Gathering detailed insights and metrics for promisify-loader-runner
Gathering detailed insights and metrics for promisify-loader-runner
Gathering detailed insights and metrics for promisify-loader-runner
Gathering detailed insights and metrics for promisify-loader-runner
npm install promisify-loader-runner
Typescript
Module System
Node Version
NPM Version
TypeScript (66.39%)
Vue (28.94%)
SCSS (3.43%)
JavaScript (0.58%)
Dockerfile (0.4%)
HTML (0.25%)
CSS (0.01%)
Total Downloads
1,409
Last Day
5
Last Week
5
Last Month
17
Last Year
1,135
MIT License
6 Stars
146 Commits
1 Forks
2 Watchers
13 Branches
1 Contributors
Updated on Mar 17, 2025
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
promisify-loader-runner@1.0.1
Unpacked Size
6.87 kB
Size
2.47 kB
File Count
8
NPM Version
9.7.2
Node Version
18.16.1
Published on
Nov 24, 2023
Cumulative downloads
Total Downloads
Last Day
0%
5
Compared to previous day
Last Week
25%
5
Compared to previous week
Last Month
41.7%
17
Compared to previous month
Last Year
314.2%
1,135
Compared to previous year
2
2
This is a promisify method of loader-runner
https://github.com/webpack/loader-runner
and you can use both promisify
or callback
calling style
1import { runLoaders } from "promisify-loader-runner"; 2 3try { 4 const result = await runLoaders({ 5 resource: "/abs/path/to/file.txt?query", 6 loaders: ["/abs/path/to/loader.js?query"], 7 context: { minimize: true }, 8 processResource: (loaderContext, resourcePath, callback) => { ... }, 9 readResource: fs.readFile.bind(fs) 10 }) 11} catch (err){ 12 // err: Error? 13}
1import { runLoaders } from "promisify-loader-runner"; 2 3runLoaders({ 4 resource: "/abs/path/to/file.txt?query", 5 // String: Absolute path to the resource (optionally including query string) 6 7 loaders: ["/abs/path/to/loader.js?query"], 8 // String[]: Absolute paths to the loaders (optionally including query string) 9 // {loader, options}[]: Absolute paths to the loaders with options object 10 11 context: { minimize: true }, 12 // Additional loader context which is used as base context 13 14 processResource: (loaderContext, resourcePath, callback) => { ... }, 15 // Optional: A function to process the resource 16 // Must have signature function(context, path, function(err, buffer)) 17 // By default readResource is used and the resource is added a fileDependency 18 19 readResource: fs.readFile.bind(fs) 20 // Optional: A function to read the resource 21 // Only used when 'processResource' is not provided 22 // Must have signature function(path, function(err, buffer)) 23 // By default fs.readFile is used 24}, function(err, result) { 25 // err: Error? 26 27 // result.result: Buffer | String 28 // The result 29 // only available when no error occurred 30 31 // result.resourceBuffer: Buffer 32 // The raw resource as Buffer (useful for SourceMaps) 33 // only available when no error occurred 34 35 // result.cacheable: Bool 36 // Is the result cacheable or do it require reexecution? 37 38 // result.fileDependencies: String[] 39 // An array of paths (existing files) on which the result depends on 40 41 // result.missingDependencies: String[] 42 // An array of paths (not existing files) on which the result depends on 43 44 // result.contextDependencies: String[] 45 // An array of paths (directories) on which the result depends on 46})
No vulnerabilities found.
No security vulnerabilities found.