{"id":13602765,"url":"https://github.com/osdevisnot/klap","last_synced_at":"2025-07-23T04:05:32.988Z","repository":{"id":35174393,"uuid":"216624173","full_name":"osdevisnot/klap","owner":"osdevisnot","description":"zero config, zero dependency bundler for tiny javascript packages","archived":false,"fork":false,"pushed_at":"2023-03-06T14:15:16.000Z","size":2374,"stargazers_count":187,"open_issues_count":18,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-26T09:52:11.550Z","etag":null,"topics":["babel","build","bundle","bundling","esm","esmodules","microlib","module-bundler","npm","packaging","react","rollup","tiny-javascript-packages","tiny-modules","typescript","umd","watch","yarn"],"latest_commit_sha":null,"homepage":"https://npm.im/klap","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/osdevisnot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-10-21T17:18:07.000Z","updated_at":"2025-02-28T08:04:59.000Z","dependencies_parsed_at":"2024-01-14T04:38:09.925Z","dependency_job_id":"a8eb24f0-8f3b-42a6-b13e-632d811d122f","html_url":"https://github.com/osdevisnot/klap","commit_stats":{"total_commits":254,"total_committers":7,"mean_commits":"36.285714285714285","dds":"0.14960629921259838","last_synced_commit":"cd1f5bca943584f13f5b3912e0c12e53e18d8d1b"},"previous_names":[],"tags_count":112,"template":false,"template_full_name":null,"purl":"pkg:github/osdevisnot/klap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fklap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fklap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fklap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fklap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osdevisnot","download_url":"https://codeload.github.com/osdevisnot/klap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fklap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266614400,"owners_count":23956363,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["babel","build","bundle","bundling","esm","esmodules","microlib","module-bundler","npm","packaging","react","rollup","tiny-javascript-packages","tiny-modules","typescript","umd","watch","yarn"],"created_at":"2024-08-01T18:01:37.294Z","updated_at":"2025-07-23T04:05:32.965Z","avatar_url":"https://github.com/osdevisnot.png","language":"JavaScript","readme":"# klap :clap:\n\n## a zero config, zero dependency bundler for tiny javascript packages.\n\n\u003c!-- prettier-ignore-start --\u003e\n[![Build Status](https://github.com/osdevisnot/klap/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/osdevisnot/klap/actions/workflows/build.yml)\n![David](https://img.shields.io/david/osdevisnot/klap?style=flat-square)\n![David](https://img.shields.io/david/dev/osdevisnot/klap?style=flat-square)\n![npm](https://img.shields.io/npm/v/klap?style=flat-square)\n![NPM](https://img.shields.io/npm/l/klap?style=flat-square)\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003cimg src=\"klap-init.gif\" alt=\"klap output\"\u003e\n\n## :sparkles: Features\n\n- :tada: **zero config**: bundle your library using only a `package.json`\n- :boom: **zero config**: typescript support (just rename `*.js` to `*.ts`)\n- :star2: **zero config**: code transforms using babel macros\n- :rainbow: **zero config**: code generation using babel plugin codegen\n- :rocket: **zero dependency**: uses [gcc-style bundling](https://www.npmjs.com/package/@vercel/ncc).\n- :octopus: creates **tiny bundles** for multiple output formats `cjs`, `esm` and `umd`\n- :fire: **Modern JS** syntax with class properties, async/await, and generators\n- :zap: Built in Minification and Gzip Size Tracking\n- :cyclone: Built in development server for quick prototyping.\n- :confetti_ball: Supports **`react`**, **`styled-components`** and **`emotion`** out of the box.\n\n### :muscle: Powered By\n\n- [rollup](https://rollupjs.org) - Next-generation ES module bundler\n- [babel](https://babeljs.io) - The compiler for next generation JavaScript\n- [typescript](https://www.typescriptlang.org/) - Typed JavaScript at Any Scale.\n\n## :plate_with_cutlery: Usage\n\nFirst, initialize your project using `klap init`:\n\n```bash\nnpx klap init\n```\n\n**Prefer Typescript ?** initialize using `ts` argument:\n\n```bash\nnpx klap init ts\n```\n\n**Want to use JSX with Typescript?** `init` using `tsx` argument:\n\n```bash\nnpx klap init tsx\n```\n\nThe `init` command will create a minimal `package.json` with `source`, `main`, `module` and `browser` entries and the `build`, `watch` and `start` scripts.\n\n```jsonc\n{\n  \"name\": \"...\",\n  \"version\": \"0.0.0\",\n  \"files\": [ \"dist\" ],\n  \"source\": \"src/sum.js\",         # source file of your package\n  \"main\": \"dist/sum.cjs.js\",      # commonjs bundle target\n  \"module\": \"dist/sum.esm.js\",    # esm bundle target\n  \"browser\": \"dist/sum.js\",       # umd bundle target\n  \"scripts\": {\n    \"build\": \"klap build\",        # bundle your package\n    \"watch\": \"klap watch\",        # bundle your package and watch for changes\n    \"start\": \"klap start\",        # start a development server\n  },\n  \"devDependencies\": {\n    \"klap\": \"3.2.0\"               # klap as dev dependency\n  }\n}\n\n```\n\n\u003e Note: Dropping `pkg.main` will disable `cjs` output, also applies to `esm` and `umd` outputs.\n\nThen use `npm run` or `yarn` to invoke npm scripts as you normally would.\n\n\u003e See [examples](examples) for common use cases using `klap`.\n\n### :anger: Granular Control\n\n`klap` uses sensible defaults for most part. However, as needed, use below properties in `package.json` to fine tune `klap`. You can also use `cli flags` to control config options for `klap`.\n\n| option            | cli flag(s)            | description                                    | default                                                       |\n| ----------------- | ---------------------- | ---------------------------------------------- | ------------------------------------------------------------- |\n| `source`          | -s\u0026nbsp;--source       | source file to compile and bundle              | `src/index.js`                                                |\n| `cjs`             | -c\u0026nbsp;--cjs          | the output file for common js format           | pkg.main                                                      |\n| `esm`             | -e\u0026nbsp;--esm          | the output file for esm format                 | pkg.module                                                    |\n| `umd`             | -u\u0026nbsp;--umd          | the output file for umd format                 | pkg.browser                                                   |\n| `types`           | -t\u0026nbsp;--types        | the output file for type definitions           | pkg.types                                                     |\n| `browserslist`    | -b\u0026nbsp;--browserslist | browserslist compatible compilation target     | `last 2 versions modern browsers if usage is greater than 1%` |\n| `klap.name`       | -n\u0026nbsp;--name         | package name for `umd` bundles                 | sanitized `pkg.name`                                          |\n| `klap.port`       | -p\u0026nbsp;--port         | port for development server                    | `1234`                                                        |\n| `klap.example`    | --example              | location of index js/ts file for start command | `public/index.js` or `pkg.source`                             |\n| `klap.fallback`   | --fallback             | location of index html file for start command  | `public/index.html`                                           |\n| `klap.target`     | --target               | target for development server (`umd, es`)      | `es`                                                          |\n| `klap.sourcemap`  | --no-sourcemap         | sourcemaps for builds                          | `true`                                                        |\n| `klap.minify`     | --no-minify            | minification for builds                        | `true`                                                        |\n| `klap.runtime`    | --runtime              | the runtime for new JSX transform              | `react`                                                       |\n| `klap.pragma`     | --pragma               | the JSX Pragma for classic runtime             | `react`                                                       |\n| `klap.pragmaFrag` | --pragmaFrag           | JSX Fragment pragma                            | `react`                                                       |\n| `klap.usets`      | --usets                | use typescript compiler for the project        | `false`                                                       |\n| `klap.globals`    |                        | global names for umd bundles                   | `{}`                                                          |\n\n\u003e `--usets` allows the library code to use typescript features not supported by `@babel/preset-typescript`. See [const-enums](examples/const-enums) example to enable usage of const enums.\n\n## :clinking_glasses: License\n\n**klap** is licensed under the [MIT License](http://opensource.org/licenses/MIT).\n\nDocumentation is licensed under [Creative Common License](http://creativecommons.org/licenses/by/4.0/).\n\nCreated with ❤️ by [@osdevisnot](https://github.com/osdevisnot) and [all contributors](https://github.com/osdevisnot/klap/graphs/contributors).\n\n## :sparkles: Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://v1rtl.site\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/35937217?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ev 1 r t l\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/osdevisnot/klap/commits?author=talentlessguy\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dnl-brnr\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/58155720?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniel Berner\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/osdevisnot/klap/commits?author=dnl-brnr\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Tom-Julux\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/42802270?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTom Julius\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/osdevisnot/klap/commits?author=Tom-Julux\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/marcuslindblom\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/319720?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarcus Lindblom\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/osdevisnot/klap/commits?author=marcuslindblom\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## :gift_heart: Supporters\n\n- [JetBrains](https://www.jetbrains.com/?from=klap) has been kind enough to support `klap` with an [open source license](https://www.jetbrains.com/community/opensource/?from=klap).\n","funding_links":[],"categories":["Projects","JavaScript","babel"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosdevisnot%2Fklap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosdevisnot%2Fklap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosdevisnot%2Fklap/lists"}