Node.js PAC script parser and executor. Current stable version 0.5.1 (last published ~2018). Low maintenance; last commit years ago. Parses PAC files to determine proxy settings for given URLs. Supports HTTP(S) and local PAC files with automatic caching and refresh. Provides both standard proxy string format and Whistle-compatible format. Minimal dependencies; suitable for basic proxy resolution in Node.js applications.
npm install node-pacNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a PAC instance from a remote URL and resolve proxy for a URL using FindProxyForURL callback.
Wrap calls in a Promise: new Promise((resolve, reject) => pac.FindProxyForURL(url, (err, res) => err ? reject(err) : resolve(res)))
Use the documented casing 'FindProxyForURL' for consistency; both work but prefer the documented one.
Set cacheTime: 0 in options to disable caching, or call pac.forceUpdate() before each request.
Use pac.forceUpdate() to ensure errors are propagated, or implement your own error handling around fetch.
Consider using alternative PAC libraries that are actively maintained, such as 'pac-proxy-agent' or 'proxy-agent'.
Run 'npm install node-pac' and ensure require path is correct (use 'node-pac' not './node-pac').
Ensure you create an instance: const pac = new Pac(options); then call pac.FindProxyForURL(url, cb).
Check the PAC URL is accessible. Use a local PAC file or handle network errors gracefully.
Use 'FindProxyForURL' (capital F) as documented. Both exist but prefer documented version.
No dependency data recorded yet.