{"id":17445954,"url":"https://github.com/jamen/pull-minify-js","last_synced_at":"2025-09-25T01:31:05.855Z","repository":{"id":57332032,"uuid":"90640234","full_name":"jamen/pull-minify-js","owner":"jamen","description":"Minify JavaScript files or buffers inside a pull-stream","archived":false,"fork":false,"pushed_at":"2017-05-13T05:06:58.000Z","size":22,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T09:42:27.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamen.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-08T14:54:16.000Z","updated_at":"2023-02-19T08:56:35.000Z","dependencies_parsed_at":"2022-09-02T16:12:31.374Z","dependency_job_id":null,"html_url":"https://github.com/jamen/pull-minify-js","commit_stats":null,"previous_names":["jamen/pull-uglify"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-minify-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-minify-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-minify-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-minify-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/pull-minify-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234143357,"owners_count":18786140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-17T18:18:45.907Z","updated_at":"2025-09-25T01:31:00.604Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# pull-minify-js\n\n\u003e Minify JavaScript files or buffers inside a pull-stream\n\nMinifies [streamed JavaScript files](https://npmjs.com/pull-files) using [`uglify-js`](https://npmjs.com/uglify-js)\n\n```js\nconst pull = require('pull-stream')\nconst { read, write } = require('pull-files')\nconst minify = require('pull-minify-js')\n\npull(\n  read([ 'index.js', 'test.js' ], { cwd: __dirname }),\n  minify({\n    mangle: true,\n    toplevel: true\n  }),\n  write(__dirname + '/out', err =\u003e {\n    // done\n  })\n)\n```\n\nUse `minify.buffer` if you are streaming JavaScript buffers instead\n\n```js\npull(\n  readFile(__dirname + '/foo.js'),\n  minify.buffer({ mangle: true, toplevel: true }),\n  writeFile(__dirname + '/out.js')\n)\n```\n\n## Install\n\n```sh\nnpm install --save pull-minify-js\n```\n\n```sh\nyarn add pull-minify-js\n```\n\n## Usage\n\n### `minify(options?)`\n\nA stream that maps each JavaScript file to the minified version.  See [`uglify-js`'s options](https://www.npmjs.com/package/uglify-js#usage) further configuration.\n\n```js\npull(\n  read([ 'index.js', 'lib/**/*.js' ], { cwd: __dirname }),\n  bundle('app.js', [ 'es2040' ]),\n  uglify({ ...options }),\n  write(__dirname + '/out', err =\u003e {\n    // ...\n  })\n)\n```\n\nYou can make it map all files regardless of extensions, by passing `strict: false`\n\n```js\nminify({ strict: false, ... })\n```\n\n### `minify.buffer(options?)`\n\nThe base implementation that compiles buffer to buffer, instead of file to file.  Options are the same\n\n```js\npull(\n  readFile(__dirname + '/foo.js'),\n  minify.buffer({ ...options }),\n  writeFile(__dirname + '/foo.min.js')\n)\n```\n\n---\n\nMaintained by [Jamen Marz](https://git.io/jamen) (See on [Twitter](https://twitter.com/jamenmarz) and [GitHub](https://github.com/jamen) for questions \u0026 updates)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fpull-minify-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Fpull-minify-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fpull-minify-js/lists"}