Gathering detailed insights and metrics for preact-context
Gathering detailed insights and metrics for preact-context
Gathering detailed insights and metrics for preact-context
Gathering detailed insights and metrics for preact-context
npm install preact-context
Typescript
Module System
Node Version
NPM Version
97.9
Supply Chain
89.7
Quality
75.8
Maintenance
100
Vulnerability
100
License
TypeScript (79.79%)
JavaScript (20.21%)
Total Downloads
15,428,616
Last Day
3,801
Last Week
34,026
Last Month
180,561
Last Year
2,399,424
151 Stars
103 Commits
8 Forks
3 Watching
9 Branches
3 Contributors
Latest Version
1.1.4
Package Id
preact-context@1.1.4
Size
6.85 kB
NPM Version
6.9.0
Node Version
8.11.4
Publised On
01 Oct 2019
Cumulative downloads
Total Downloads
Last day
-54.7%
3,801
Compared to previous day
Last week
-20.8%
34,026
Compared to previous week
Last month
1.4%
180,561
Compared to previous month
Last year
-1%
2,399,424
Compared to previous year
1
37
createContext
for preactThis is an implementation of react's new context api. You can read more about it on react's documentation page.
This package provides the createContext
factory function that can be used
in order to create a context:
1import { h } from "preact"; 2import { createContext } from "preact-context"; 3 4const Theme = createContext("dark");
The returned object contains two components: a Provider
and a Consumer
.
Consumer
It can be used in order to consume the provided object:
1<Theme.Consumer>{theme => <p>Selected theme: {theme}</p>}</Theme.Consumer>
Alternatively, it can also be used with a render property:
1<Theme.Consumer render={theme => <p>Selected theme: {theme}</p>} />
Provider
can be used in order to update the value of a context:
1<Theme.Provider value="sunny">
will change "dark" to "sunny" and notify all it's consumers of the change.
This project has been written with typescript.
The watch
script will watch for changes, compile and run the tests.
$ npm i
$ npm run watch
Licensed under the Apache License, Version 2.0
Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/24 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
83 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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