{"id":21158248,"url":"https://github.com/simbo/jstransformer-terser","last_synced_at":"2025-07-19T04:32:06.262Z","repository":{"id":57286476,"uuid":"323214929","full_name":"simbo/jstransformer-terser","owner":"simbo","description":"Sync and Async Terser support for JSTransformers.","archived":false,"fork":false,"pushed_at":"2020-12-27T19:01:00.000Z","size":281,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T05:52:25.401Z","etag":null,"topics":["jstransformer","minify","terser"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/simbo.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":"2020-12-21T02:54:31.000Z","updated_at":"2020-12-27T18:59:52.000Z","dependencies_parsed_at":"2022-09-20T01:03:30.478Z","dependency_job_id":null,"html_url":"https://github.com/simbo/jstransformer-terser","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/simbo/jstransformer-terser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fjstransformer-terser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fjstransformer-terser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fjstransformer-terser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fjstransformer-terser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simbo","download_url":"https://codeload.github.com/simbo/jstransformer-terser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fjstransformer-terser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265888899,"owners_count":23844527,"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":["jstransformer","minify","terser"],"created_at":"2024-11-20T12:19:01.748Z","updated_at":"2025-07-19T04:32:06.225Z","avatar_url":"https://github.com/simbo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jstransformer-terser\n\nSync and Async [Terser](https://github.com/terser/terser) support for [JSTransformers](http://github.com/jstransformers).\n\n\u003e Minifies javascript using terser via jstransformers.\n\n[![npm Package Version](https://img.shields.io/npm/v/jstransformer-terser?)](https://www.npmjs.com/package/jstransformer-terser)\n[![Package Dependencies](https://img.shields.io/david/simbo/jstransformer-terser?label=deps)](https://www.npmjs.com/package/jstransformer-terser?activeTab=dependencies)\n[![Coveralls github](https://img.shields.io/coveralls/github/simbo/jstransformer-terser)](https://coveralls.io/github/simbo/jstransformer-terser)\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/simbo/jstransformer-terser/CI/master)](https://github.com/simbo/jstransformer-terser/actions?query=workflow%3ACI)\n[![GitHub Repo](https://img.shields.io/badge/repo-public-87ceeb)](https://github.com/simbo/jstransformer-terser)\n[![License MIT](https://img.shields.io/badge/license-MIT-4cc552)](http://simbo.mit-license.org/)\n\n---\n\n## Install\n\n```sh\n# install using npm\nnpm install --save jstransformer-terser terser\n# install using yarn\nyarn add jstransformer-terser terser\n```\n\n## API\n\nThis transformer supports `render`, `renderAsync`, `renderFile` and `renderFileAsync`.\nAll according to the [jstransformer API](https://github.com/jstransformers/jstransformer#api) definition.\n\n```js\nvar terserTransformer = require('jstransformer')(require('jstransformer-terser'));\n\n// SYNC\nconst result = terserTransformer.render('function add(first, second) { return first + second; }');\nconsole.log(result.body);\n//=\u003e 'function add(n,d){return n+d;}'\n\n// ASYNC (Promise API)\nterserTransformer\n  .renderAsync('function add(first, second) { return first + second; }')\n  .then(result =\u003e console.log(result.body));\n//=\u003e 'function add(n,d){return n+d;}'\n\n// ASYNC (Callback API)\nterserTransformer.renderAsync('function add(first, second) { return first + second; }', {}, (err, result) =\u003e {\n  if (err) console.error(err);\n  else console.log(result.body);\n});\n//=\u003e 'function add(n,d){return n+d;}'\n```\n\n## Development\n\nRequirements: node.js \u003e=14, yarn \u003e=1.22\n\n```sh\n# build using tsc\nyarn build\n# watch and rebuild\nyarn build:watch\n# lint using prettier and eslint\nyarn lint\n# test using jest\nyarn test\n# watch and retest\nyarn test:watch\n# open coverage in default browser\nyarn coverage:open\n# check everything\nyarn preflight\n```\n\n## License and Author\n\n[MIT \u0026copy; Simon Lepel](http://simbo.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fjstransformer-terser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimbo%2Fjstransformer-terser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fjstransformer-terser/lists"}