{"id":19383,"library":"binary-loader","title":"webpack binary-loader","description":"A webpack loader that returns a file's content as a binary string. Adapted from raw-loader. Version 0.0.1, no recent updates. Key differentiators: allows importing binary files as strings without base64 encoding. No active maintenance, use raw-loader or file-loader with encoding options instead.","status":"deprecated","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/martijnvermaat/binary-loader","tags":["javascript"],"install":[{"cmd":"npm install binary-loader","lang":"bash","label":"npm"},{"cmd":"yarn add binary-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add binary-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, loader designed for webpack","package":"webpack","optional":false}],"imports":[{"note":"Webpack loaders use require syntax; ESM import may work depending on webpack version but not officially supported.","wrong":"import content from 'binary!./file.bin'","symbol":"default","correct":"require('binary!./file.bin')"},{"note":"Loaders are CommonJS modules; ESM export is not supported.","wrong":"export default function(content) {}","symbol":"loader function","correct":"module.exports = function(content) {}"}],"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.bin$/,\n        use: 'binary-loader'\n      }\n    ]\n  }\n};\n\n// app.js\nvar binaryData = require('./file.bin');\nconsole.log(binaryData); // binary string of file content","lang":"javascript","description":"Shows how to configure webpack to use binary-loader for .bin files and import them as binary strings."},"warnings":[{"fix":"Use raw-loader or file-loader instead.","message":"This package is no longer maintained and has limited functionality.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use webpack 4+ compatible alternatives.","message":"Works only with legacy webpack 1/2; incompatible with webpack 4+ without additional configuration.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Consider using raw-loader or file-loader for proper binary handling.","message":"Output is a binary string (not Buffer or ArrayBuffer), which may cause issues with binary data handling.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install binary-loader' and ensure it's in node_modules.","cause":"Missing npm install or local path issue.","error":"Module not found: Error: Can't resolve 'binary-loader' in /path"},{"fix":"Use 'binary-loader' or 'binary!./file.bin' (with exclamation) in require.","cause":"Loader name typo.","error":"Module build failed: loader 'binary' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}