Gathering detailed insights and metrics for taro-hooks
Gathering detailed insights and metrics for taro-hooks
Gathering detailed insights and metrics for taro-hooks
Gathering detailed insights and metrics for taro-hooks
npm install taro-hooks
Typescript
Module System
Min. Node Version
Node Version
NPM Version
taro-hooks v2.2.0
Updated on Apr 06, 2025
taro-hooks v2.1.0
Updated on Jul 26, 2024
taro-hooks v2.0.11
Updated on Apr 25, 2024
taro-hooks v2.0.10
Updated on Jan 14, 2024
taro-hooks v2.0.9
Updated on Jan 14, 2024
taro-hooks v2.0.8
Updated on Dec 03, 2023
TypeScript (55.64%)
JavaScript (30.7%)
MDX (8.76%)
SCSS (3.4%)
Less (0.87%)
CSS (0.31%)
HTML (0.24%)
Shell (0.07%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
444 Stars
585 Commits
38 Forks
4 Watchers
7 Branches
8 Contributors
Updated on Jul 02, 2025
Latest Version
2.2.0
Package Id
taro-hooks@2.2.0
Unpacked Size
320.18 kB
Size
67.21 kB
File Count
325
NPM Version
10.8.2
Node Version
20.18.0
Published on
Apr 06, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
6
2
3
Hooks Library for Taro
1# npm 2$ npm i taro-hooks 3# yarn 4$ yarn add taro-hooks 5# pnpm 6$ pnpm add taro-hooks
We use plugins for extending different frameworks. So you need to install the corresponding plugins according to the framework you are currently using
1# npm 2$ npm i @taro-hooks/plugin-react 3# yarn 4$ yarn add @taro-hooks/plugin-react 5# pnpm 6$ pnpm add @taro-hooks/plugin-react
1// config/index.js 2module.exports = { 3 // ... 4 plugins: ['@taro-hooks/plugin-react'], 5 // ... 6};
1# npm 2$ npm i @taro-hooks/plugin-vue 3# yarn 4$ yarn add @taro-hooks/plugin-vue 5# pnpm 6$ pnpm add @taro-hooks/plugin-vue
1// config/index.js 2module.exports = { 3 // ... 4 plugins: ['@taro-hooks/plugin-vue'], 5 // ... 6};
1import { useEnv } from 'taro-hooks'; 2 3function Index() { 4 const env = useEnv(); 5 6 return <View>current env: {env}</View>; 7}
1<template> 2 <view>current env: {{env}}</view> 3</template> 4 5<script setup lang="ts"> 6 import { useEnv } from 'taro-hooks'; 7 8 const env = useEnv(); 9</script>
We provide the @taro-hooks/plugin-auto-import plugin to help you quickly use the unplugin-auto-import capability.
1# npm 2$ npm i @taro-hooks/plugin-auto-import 3# yarn 4$ yarn add @taro-hooks/plugin-auto-import 5# pnpm 6$ pnpm add @taro-hooks/plugin-auto-import
1// config/index.js 2const config = { 3 // ... 4 // The main prerequisite is that you have installed the plugin for the corresponding framework. 5 plugins: [ 6 // If you are using vue3, please install the @taro-hooks/plugin-vue plugin beforehand. 7 '@taro-hooks/plugin-vue', 8 // If using React/PReact/Nerv, please pre-install the @taro-hooks/plugin-react plugin. 9 '@taro-hooks/plugin-react', 10 // Finally, the auto-import plugin is configured 11 [ 12 '@taro-hooks/plugin-auto-import', 13 { 14 // your options, see configuration: https://github.com/antfu/unplugin-auto-import#configuration 15 } 16 ] 17 ], 18 // ... 19};
1function Index() { 2 const env = useEnv(); 3 4 return <View>current env: {env}</View>; 5}
1<template> 2 <view>current env: {{env}}</view> 3</template> 4 5<script setup lang="ts"> 6 const env = useEnv(); 7</script>
packages | downloads | version | license |
---|---|---|---|
|
|
|
See Contributing Guide.
innocces 💬 📖 👀 📢 🤔 ⚠️ 📦 📋 🎨 | ryan 📖 📢 🤔 💻 |
MIT.
|
![]() |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 1/16 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
77 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More