Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/so1ve/unplugin-todo-or-die
TODO or Die plugin for JavaScript :)
https://github.com/so1ve/unplugin-todo-or-die
astro javascript quasar rollup rspack todo typescript unplugin vite webpack
Last synced: 19 days ago
JSON representation
TODO or Die plugin for JavaScript :)
- Host: GitHub
- URL: https://github.com/so1ve/unplugin-todo-or-die
- Owner: so1ve
- License: mit
- Created: 2023-09-12T13:01:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-13T17:29:17.000Z (7 months ago)
- Last Synced: 2024-04-14T08:01:58.461Z (7 months ago)
- Topics: astro, javascript, quasar, rollup, rspack, todo, typescript, unplugin, vite, webpack
- Language: TypeScript
- Homepage:
- Size: 363 KB
- Stars: 18
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unplugin-todo-or-die
[![NPM version](https://img.shields.io/npm/v/unplugin-todo-or-die?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-todo-or-die)
> TODO or DIEEEEEEE!!!!!!!!!!!!!
This plugin turns these TODO comments:
```ts
// TODO::expires(2021-01-01): do something
// TODO::expire(2021-01-01): do something
```Into such code:
```ts
if (Date.now() > 1_704_067_200_000) {
throw new Error("TODO expired: do something");
}
```## 📦 Installation
```bash
$ npm install -D unplugin-todo-or-die
$ yarn add -D unplugin-todo-or-die
$ pnpm add -D unplugin-todo-or-die
```## 🚀 Usage
Vite
```ts
// vite.config.ts
import TodoOrDie from "unplugin-todo-or-die/vite";export default defineConfig({
plugins: [
TodoOrDie({
/* options */
}),
],
});
```
Rollup
```ts
// rollup.config.js
import TodoOrDie from "unplugin-todo-or-die/rollup";export default {
plugins: [
TodoOrDie({
/* options */
}),
// other plugins
],
};
```
Webpack
```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("unplugin-todo-or-die/webpack")({
/* options */
}),
],
};
```
Nuxt
```ts
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["unplugin-todo-or-die/nuxt"],
});
```
Vue CLI
```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("unplugin-todo-or-die/webpack")({
/* options */
}),
],
},
};
```
Quasar
```ts
// quasar.conf.js [Vite]
module.exports = {
vitePlugins: [
[
"unplugin-todo-or-die/vite",
{
/* options */
},
],
],
};
``````ts
// quasar.conf.js [Webpack]
const TodoOrDiePlugin = require("unplugin-todo-or-die/webpack");module.exports = {
build: {
chainWebpack(chain) {
chain.plugin("unplugin-todo-or-die").use(
TodoOrDiePlugin({
/* options */
}),
);
},
},
};
```
esbuild
```ts
// esbuild.config.js
import { build } from "esbuild";build({
/* ... */
plugins: [
require("unplugin-todo-or-die/esbuild")({
/* options */
}),
],
});
```
Astro
```ts
// astro.config.mjs
import TodoOrDie from "unplugin-todo-or-die/astro";export default defineConfig({
integrations: [
TodoOrDie({
/* options */
}),
],
});
```
## 🖥️ Credits
Original version (ruby): https://github.com/searls/todo_or_die
## 📝 License
[MIT](./LICENSE). Made with ❤️ by [Ray](https://github.com/so1ve)