Gathering detailed insights and metrics for @ryoppippi/unplugin-typia
Gathering detailed insights and metrics for @ryoppippi/unplugin-typia
unplugin for Typia with an extra Bun plugin 🫶
npm install @ryoppippi/unplugin-typia
Typescript
Module System
Node Version
NPM Version
61.2
Supply Chain
88.5
Quality
89.7
Maintenance
100
Vulnerability
96.7
License
TypeScript (99.65%)
JavaScript (0.35%)
Total Downloads
20,180
Last Day
515
Last Week
1,878
Last Month
7,301
Last Year
20,180
52 Stars
707 Commits
9 Forks
1 Watching
46 Branches
4 Contributors
Latest Version
1.2.0
Package Id
@ryoppippi/unplugin-typia@1.2.0
Unpacked Size
92.24 kB
Size
26.19 kB
File Count
88
NPM Version
10.9.0
Node Version
22.12.0
Publised On
19 Jan 2025
Cumulative downloads
Total Downloads
Last day
43.1%
515
Compared to previous day
Last week
-33%
1,878
Compared to previous week
Last month
54.7%
7,301
Compared to previous month
Last year
0%
20,180
Compared to previous year
unplugin for Typia
Typia is fantastic, but it is hard to setup, even for frontend development.
If you use some bundlers for frontend like Vite
, it is even harder to setup.
This unplugin aims to make it easier to use Typia in your projects.
First, install unplugin-typia
:
1# jsr(recommended) 2npx jsr add -D @ryoppippi/unplugin-typia 3 4# npm 5npm install -D @ryoppippi/unplugin-typia
Then, install typia
:
1# install typia! (nypm detects your PM ✨) 2npx nypm add typia 3 4# setup typia! 5npx typia setup 6# pnpm dlx typia setup 7# yarn dlx typia setup 8 9# after installing typia, run prepare script 10npm run prepare
More details about setting up Typia can be found in the Typia Docs.
Then, add the unplugin to your favorite bundler:
1// vite.config.ts 2import UnpluginTypia from '@ryoppippi/unplugin-typia/vite'; 3 4export default defineConfig({ 5 plugins: [ 6 UnpluginTypia({ /* options */ }), // should be placed before other plugins like `react`, `svetle`, etc. 7 ], 8});
When using typia with types imported from non-relative paths like tsconfig
compilerOptions.paths
or relative to tsconfigcompilerOptions.baseUrl
, they must be defined in vite.config.ts under resolve.alias in order to be resolved, according to vite's resolution mechanism.
Examples:
1// esbuild.config.js 2import UnpluginTypia from '@ryoppippi/unplugin-typia/esbuild'; 3 4export default { 5 plugins: [ 6 UnpluginTypia({ /* options */ }), 7 ], 8};
Examples:
1// next.config.mjs 2import unTypiaNext from 'unplugin-typia/next'; 3 4/** @type {import('next').NextConfig} */ 5const nextConfig = { /* your next.js config */}; 6 7/** @type {import("unplugin-typia").Options} */ 8const unpluginTypiaOptions = { /* your unplugin-typia options */ }; 9 10export default unTypiaNext(nextConfig, unpluginTypiaOptions); 11 12// you can omit the unplugin-typia options when you don't need to customize it 13// export default unTypiaNext(nextConfig);
Examples:
1// build.ts 2import UnpluginTypia from '@ryoppippi/unplugin-typia/bun'; 3 4await Bun.build({ 5 entrypoints: ['./index.ts'], 6 outdir: './out', 7 plugins: [ 8 UnpluginTypia({ /* your options */}) 9 ] 10});
For building the script:
1bun run ./build.ts 2node ./out/index.js
Check the Plugins – Bundler | Bun Docs for more details.
1// preload.ts 2import { plugin } from 'bun'; 3import UnpluginTypia from '@ryoppippi/unplugin-typia/bun'; 4 5plugin(UnpluginTypia({ /* your options */}));
1# bun.toml 2preload = "preload.ts" 3 4[test] 5preload = "preload.ts"
For running the script:
1bun run ./index.ts
Check the Plugins – Runtime | Bun Docs for more details.
1// rollup.config.js 2import UnpluginTypia from '@ryoppippi/unplugin-typia/rollup'; 3 4export default { 5 plugins: [ 6 UnpluginTypia({ /* options */ }), 7 ], 8};
Examples:
⚠️ Note: Currently, this plugin works only with 'esm' target.
If you want to use 'cjs' target on Node < 20.17.0 , please use with
jiti
. If you want to use 'cjs' target on Node >= 20.17.0, please use withrequire
and enable--experimental-require-modules
flag. If you want to use 'esm' target, don't worry! You can use this plugin without any additional setup.
1npm install jiti
1// webpack.config.js 2 3// if you use Node < 20.17.0 4const jiti = require('jiti')(__filename); 5const { default: UnpluginTypia } = jiti('@ryoppippi/unplugin-typia/webpack'); 6 7// if you use Node >= 20.17.0 8// const { default: UnpluginTypia } = require("@ryoppippi/unplugin-typia/webpack"); 9 10module.exports = { 11 plugins: [ 12 UnpluginTypia({ /* options */ }), 13 ], 14};
More integration guides can be found in the JSR Doc
You can find examples in the examples/
.
.ts
.tsx
.mts
.mtsx
.svelte
(only script tag with lang="ts"
)This repository is a monorepo managed by Bun.
1bun i --frozen-lockfile
This project started as an unofficial integration of Typia for bundlers. Now, this plugin is one of the official integrations of Typia and is sponsored by @samchon (the creator of Typia).
No vulnerabilities found.
No security vulnerabilities found.