{"id":47607,"library":"fetch-js","title":"fetch-js","description":"A lightweight, reliable script loader for browsers that fetches JavaScript files and executes callbacks once the script is evaluated. Version 1.0.3 is the current stable release with no active development. It works with CommonJS (require) and has no dependencies. Key differentiator: it focuses solely on script loading with error handling, unlike heavier loaders like RequireJS or SystemJS.","status":"maintenance","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/QubitProducts/fetch-js","tags":["javascript","fetch js","script loader"],"install":[{"cmd":"npm install fetch-js","lang":"bash","label":"npm"},{"cmd":"yarn add fetch-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add fetch-js","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS only; no ESM support available.","wrong":"import fetchJs from 'fetch-js'","symbol":"fetchJs","correct":"const fetchJs = require('fetch-js')"}],"quickstart":{"code":"const fetchJs = require('fetch-js');\nfetchJs('https://code.jquery.com/jquery-3.6.0.min.js', function(err) {\n  if (err) {\n    console.error('Failed to load script:', err);\n    return;\n  }\n  console.log('Script loaded and executed!');\n  // jQuery is now available\n});","lang":"javascript","description":"Show how to install and use fetch-js to load a jQuery script with error handling."},"warnings":[{"fix":"Use dynamic import() or a more modern script loader like scriptjs or loadjs.","message":"Package is no longer actively maintained; consider using native <script> loading or modern alternatives.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use require() or switch to an ESM-compatible package.","message":"No ESM support; cannot use import syntax.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Chain fetchJs calls manually or use a Promise-based wrapper.","message":"Does not support parallel loading of multiple scripts without chaining callbacks.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.3':24 'activ':32 'browser':10 'callback':17 'commonj':37 'current':27 'depend':42 'develop':33 'differenti':44 'error':52 'evalu':22 'execut':16 'fetch':2,12,62 'fetch-j':1 'file':14 'focus':46 'handl':53 'heavier':55 'javascript':13,61 'js':3,63 'key':43 'lightweight':5 'like':57 'load':50 'loader':8,56,65 'releas':29 'reliabl':6 'requir':38 'requirej':58 'script':7,20,49,64 'sole':47 'stabl':28 'systemj':60 'unlik':54 'version':23 'work':35","created_at":"2026-06-07T16:52:22.763402+00:00","updated_at":"2026-06-07T16:52:22.763402+00:00","problems":[{"fix":"Use `const fetchJs = require('fetch-js');`","cause":"Using ES6 import syntax instead of CommonJS require.","error":"Uncaught TypeError: fetchJs is not a function"},{"fix":"Ensure the URL is correct and the CDN/script is reachable.","cause":"Network issues or incorrect URL; script fails to load.","error":"Error: Script load error: ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/QubitProducts/fetch-js#readme","github":"https://github.com/QubitProducts/fetch-js","docs":null,"changelog":null,"pypi":null,"npm":"fetch-js","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}