Installations
npm install tr-tmp-react-script-hook
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
12.6.0
NPM Version
6.9.0
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (96.76%)
JavaScript (3.24%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
hupe1980
Download Statistics
Total Downloads
363
Last Day
1
Last Week
1
Last Month
4
Last Year
53
GitHub Statistics
127 Stars
95 Commits
20 Forks
4 Watching
5 Branches
12 Contributors
Bundle Size
1.28 kB
Minified
660.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.0.17
Package Id
tr-tmp-react-script-hook@1.0.17
Unpacked Size
7.76 kB
Size
3.44 kB
File Count
9
NPM Version
6.9.0
Node Version
12.6.0
Total Downloads
Cumulative downloads
Total Downloads
363
Last day
0%
1
Compared to previous day
Last week
-50%
1
Compared to previous week
Last month
-60%
4
Compared to previous month
Last year
-17.2%
53
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
24
react-script-hook
React hook to dynamically load an external script and know when its loaded
Install
1// with npm 2npm install react-script-hook 3 4// with yarn 5yarn add react-script-hook
How to use
1import React from 'react'; 2import { StripeProvider } from 'react-stripe-elements'; 3import useScript from 'react-script-hook'; 4 5import MyCheckout from './my-checkout'; 6 7function App() { 8 const [loading, error] = useScript({ src: 'https://js.stripe.com/v3/' }); 9 10 if (loading) return <h3>Loading Stripe API...</h3>; 11 if (error) return <h3>Failed to load Stripe API: {error.message}</h3>; 12 13 return ( 14 <StripeProvider apiKey="pk_test_6pRNASCoBOKtIshFeQd4XMUh"> 15 <MyCheckout /> 16 </StripeProvider> 17 ); 18} 19 20export default App;
Use with callbacks
1useScript({
2 src: 'https://js.stripe.com/v3/',
3 onload: () => console.log('Script loaded!')
4})
License
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 3/16 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/hupe1980/react-script-hook/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/hupe1980/react-script-hook/nodejs.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 18 are checked with a SAST tool
Reason
20 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7jxr-cg7f-gpgv
- Warn: Project is vulnerable to: GHSA-xj72-wvfv-8985
- Warn: Project is vulnerable to: GHSA-ch3r-j5x3-6q2m
- Warn: Project is vulnerable to: GHSA-p5gc-c584-jj6v
- Warn: Project is vulnerable to: GHSA-whpj-8f3w-67p5
- Warn: Project is vulnerable to: GHSA-cchq-frgv-rjh5
- Warn: Project is vulnerable to: GHSA-g644-9gfx-q4q4
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
2.6
/10
Last Scanned on 2025-02-03
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