{"name":"preact","description":"Fast 3kb React-compatible Virtual DOM library.","dist-tags":{"latest":"10.19.6"},"versions":{"10.19.6":{"name":"preact","amdName":"preact","version":"10.19.6","private":false,"description":"Fast 3kb React-compatible Virtual DOM library.","main":"dist/preact.js","module":"dist/preact.module.js","umd:main":"dist/preact.umd.js","unpkg":"dist/preact.min.js","source":"src/index.js","exports":{".":{"types":"./src/index.d.ts","browser":"./dist/preact.module.js","umd":"./dist/preact.umd.js","import":"./dist/preact.mjs","require":"./dist/preact.js"},"./compat":{"types":"./compat/src/index.d.ts","browser":"./compat/dist/compat.module.js","umd":"./compat/dist/compat.umd.js","import":"./compat/dist/compat.mjs","require":"./compat/dist/compat.js"},"./debug":{"types":"./debug/src/index.d.ts","browser":"./debug/dist/debug.module.js","umd":"./debug/dist/debug.umd.js","import":"./debug/dist/debug.mjs","require":"./debug/dist/debug.js"},"./devtools":{"types":"./devtools/src/index.d.ts","browser":"./devtools/dist/devtools.module.js","umd":"./devtools/dist/devtools.umd.js","import":"./devtools/dist/devtools.mjs","require":"./devtools/dist/devtools.js"},"./hooks":{"types":"./hooks/src/index.d.ts","browser":"./hooks/dist/hooks.module.js","umd":"./hooks/dist/hooks.umd.js","import":"./hooks/dist/hooks.mjs","require":"./hooks/dist/hooks.js"},"./test-utils":{"types":"./test-utils/src/index.d.ts","browser":"./test-utils/dist/testUtils.module.js","umd":"./test-utils/dist/testUtils.umd.js","import":"./test-utils/dist/testUtils.mjs","require":"./test-utils/dist/testUtils.js"},"./jsx-runtime":{"types":"./jsx-runtime/src/index.d.ts","browser":"./jsx-runtime/dist/jsxRuntime.module.js","umd":"./jsx-runtime/dist/jsxRuntime.umd.js","import":"./jsx-runtime/dist/jsxRuntime.mjs","require":"./jsx-runtime/dist/jsxRuntime.js"},"./jsx-dev-runtime":{"types":"./jsx-runtime/src/index.d.ts","browser":"./jsx-runtime/dist/jsxRuntime.module.js","umd":"./jsx-runtime/dist/jsxRuntime.umd.js","import":"./jsx-runtime/dist/jsxRuntime.mjs","require":"./jsx-runtime/dist/jsxRuntime.js"},"./compat/client":{"import":"./compat/client.mjs","require":"./compat/client.js"},"./compat/server":{"browser":"./compat/server.browser.js","import":"./compat/server.mjs","require":"./compat/server.js"},"./compat/jsx-runtime":{"types":"./jsx-runtime/src/index.d.ts","import":"./compat/jsx-runtime.mjs","require":"./compat/jsx-runtime.js"},"./compat/jsx-dev-runtime":{"types":"./jsx-runtime/src/index.d.ts","import":"./compat/jsx-dev-runtime.mjs","require":"./compat/jsx-dev-runtime.js"},"./compat/scheduler":{"import":"./compat/scheduler.mjs","require":"./compat/scheduler.js"},"./package.json":"./package.json","./compat/package.json":"./compat/package.json","./debug/package.json":"./debug/package.json","./devtools/package.json":"./devtools/package.json","./hooks/package.json":"./hooks/package.json","./test-utils/package.json":"./test-utils/package.json","./jsx-runtime/package.json":"./jsx-runtime/package.json"},"license":"MIT","funding":{"type":"opencollective","url":"https://opencollective.com/preact"},"types":"src/index.d.ts","scripts":{"prepare":"run-s build && check-export-map","build":"npm-run-all --parallel build:*","build:core":"microbundle build --raw --no-generateTypes -f cjs,esm,umd","build:core-min":"microbundle build --raw --no-generateTypes -f cjs,esm,umd,iife src/cjs.js -o dist/preact.min.js","build:debug":"microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd debug","build:devtools":"microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd devtools","build:hooks":"microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd hooks","build:test-utils":"microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd test-utils","build:compat":"microbundle build src/index.js src/scheduler.js --raw --no-generateTypes -f cjs,esm,umd --cwd compat --globals 'preact/hooks=preactHooks'","build:jsx":"microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd jsx-runtime","postbuild":"node ./config/node-13-exports.js && node ./config/compat-entries.js","dev":"microbundle watch --raw --no-generateTypes --format cjs","dev:hooks":"microbundle watch --raw --no-generateTypes --format cjs --cwd hooks","dev:compat":"microbundle watch --raw --no-generateTypes --format cjs --cwd compat --globals 'preact/hooks=preactHooks'","test":"npm-run-all build lint test:unit","test:unit":"run-p test:mocha test:karma:minify test:ts","test:ts":"run-p test:ts:*","test:ts:core":"tsc -p test/ts/ && mocha --require \"@babel/register\" test/ts/**/*-test.js","test:ts:compat":"tsc -p compat/test/ts/","test:mocha":"mocha --recursive --require \"@babel/register\" test/shared test/node","test:mocha:watch":"npm run test:mocha -- --watch","test:karma":"cross-env COVERAGE=true BABEL_NO_MODULES=true karma start karma.conf.js --single-run","test:karma:minify":"cross-env COVERAGE=true MINIFY=true BABEL_NO_MODULES=true karma start karma.conf.js --single-run","test:karma:watch":"cross-env BABEL_NO_MODULES=true karma start karma.conf.js --no-single-run","test:karma:hooks":"cross-env COVERAGE=false BABEL_NO_MODULES=true karma start karma.conf.js --grep=hooks/test/browser/**.js --no-single-run","test:karma:test-utils":"cross-env PERFORMANCE=false COVERAGE=false BABEL_NO_MODULES=true karma start karma.conf.js --grep=test-utils/test/shared/**.js --no-single-run","test:karma:bench":"cross-env PERFORMANCE=true COVERAGE=false BABEL_NO_MODULES=true karma start karma.conf.js --grep=test/benchmarks/**.js --single-run","benchmark":"npm run test:karma:bench -- no-single-run","lint":"run-s eslint tsc","tsc":"tsc -p jsconfig-lint.json","eslint":"eslint src test debug compat hooks test-utils","format":"prettier --write \"**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}\"","format:check":"prettier --check '**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}'"},"eslintConfig":{"extends":["developit","prettier"],"settings":{"react":{"pragma":"createElement"}},"rules":{"camelcase":[1,{"allow":["__test__*","unstable_*","UNSAFE_*"]}],"no-unused-vars":[2,{"args":"none","varsIgnorePattern":"^h|React$"}],"prefer-rest-params":0,"prefer-spread":0,"no-cond-assign":0,"react/jsx-no-bind":0,"react/no-danger":"off","react/prefer-stateless-function":0,"react/sort-comp":0,"jest/valid-expect":0,"jest/no-disabled-tests":0,"jest/no-test-callback":0,"jest/expect-expect":0,"jest/no-standalone-expect":0,"jest/no-export":0,"react/no-find-dom-node":0}},"eslintIgnore":["test/fixtures","test/ts/","*.ts","dist"],"prettier":{"singleQuote":true,"trailingComma":"none","arrowParens":"avoid"},"lint-staged":{"**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"authors":["The Preact Authors (https://github.com/preactjs/preact/contributors)"],"repository":{"type":"git","url":"git+https://github.com/preactjs/preact.git"},"bugs":{"url":"https://github.com/preactjs/preact/issues"},"devDependencies":{"@actions/github":"^5.0.0","@actions/glob":"^0.2.0","@babel/core":"^7.7.0","@babel/plugin-proposal-object-rest-spread":"^7.6.2","@babel/plugin-transform-react-jsx":"^7.7.0","@babel/plugin-transform-react-jsx-source":"^7.7.4","@babel/preset-env":"^7.7.1","@babel/register":"^7.7.0","@types/chai":"^4.1.2","@types/mocha":"^5.0.0","@types/node":"^14.14.10","babel-plugin-istanbul":"^6.0.0","babel-plugin-transform-async-to-promises":"^0.8.15","babel-plugin-transform-rename-properties":"0.1.0","benchmark":"^2.1.4","chai":"^4.1.2","check-export-map":"^1.3.0","coveralls":"^3.0.0","cross-env":"^7.0.2","diff":"^5.0.0","errorstacks":"^2.4.0","esbuild":"^0.14.50","eslint":"5.15.1","eslint-config-developit":"^1.1.1","eslint-config-prettier":"^6.5.0","eslint-plugin-react":"7.12.4","husky":"^4.3.0","karma":"^6.3.16","karma-chai-sinon":"^0.1.5","karma-chrome-launcher":"^3.1.0","karma-coverage":"^2.1.0","karma-esbuild":"^2.2.4","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-sauce-launcher":"^4.3.4","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","kolorist":"^1.2.10","lint-staged":"^10.5.2","lodash":"^4.17.20","microbundle":"^0.15.1","mocha":"^8.2.1","npm-merge-driver-install":"^1.1.1","npm-run-all":"^4.0.0","preact-render-to-string":"^5.2.5","prettier":"^2.8.6","prop-types":"^15.7.2","sade":"^1.7.4","sinon":"^9.2.3","sinon-chai":"^3.5.0","typescript":"^4.9.5","undici":"^4.12.0"},"overrides":{"webdriverio":"7.30.2"},"volta":{"node":"20.9.0"},"_id":"preact@10.19.6","_integrity":"sha512-gympg+T2Z1fG1unB8NH29yHJwnEaCH37Z32diPDku316OTnRPeMbiRV9kTrfZpocXjdfnWuFUl/Mj4BHaf6gnw==","_resolved":"/Users/jovi/Documents/SideProjects/preact/preact-10.19.6.tgz","_from":"file:preact-10.19.6.tgz","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-gympg+T2Z1fG1unB8NH29yHJwnEaCH37Z32diPDku316OTnRPeMbiRV9kTrfZpocXjdfnWuFUl/Mj4BHaf6gnw==","shasum":"66007b67aad4d11899f583df1b0116d94a89b8f5","tarball":"http://localhost:4260/preact/preact-10.19.6.tgz","fileCount":131,"unpackedSize":1370954,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDh1diBOzydVPt9VeQt4EOfIOOPJu7BkY12zPdurgT9zgIgfuNN2AnNgP+o3Vg9jfoa1JFpRCWardIoyTYqKPKUegY="}]},"directories":{},"_hasShrinkwrap":false}},"readme":"

\n\n\n![Preact](https://raw.githubusercontent.com/preactjs/preact/8b0bcc927995c188eca83cba30fbc83491cc0b2f/logo.svg?sanitize=true 'Preact')\n\n\n

\n

Fast 3kB alternative to React with the same modern API.

\n\n**All the power of Virtual DOM components, without the overhead:**\n\n- Familiar React API & patterns: ES6 Class, hooks, and Functional Components\n- Extensive React compatibility via a simple [preact/compat] alias\n- Everything you need: JSX, VDOM, [DevTools], HMR, SSR.\n- Highly optimized diff algorithm and seamless hydration from Server Side Rendering\n- Supports all modern browsers and IE11\n- Transparent asynchronous rendering with a pluggable scheduler\n\n### 💁 More information at the [Preact Website ➞](https://preactjs.com)\n\n\n\n\n\n\n\n\n
\n\n[![npm](https://img.shields.io/npm/v/preact.svg)](http://npm.im/preact)\n[![Preact Slack Community](https://img.shields.io/badge/Slack%20Community-preact.slack.com-blue)](https://chat.preactjs.com)\n[![OpenCollective Backers](https://opencollective.com/preact/backers/badge.svg)](#backers)\n[![OpenCollective Sponsors](https://opencollective.com/preact/sponsors/badge.svg)](#sponsors)\n\n[![coveralls](https://img.shields.io/coveralls/preactjs/preact/main.svg)](https://coveralls.io/github/preactjs/preact)\n[![gzip size](http://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=gzip&label=gzip)](https://unpkg.com/preact/dist/preact.min.js)\n[![brotli size](http://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=brotli&label=brotli)](https://unpkg.com/preact/dist/preact.min.js)\n\n\n\n\n\n
\n\nYou can find some awesome libraries in the [awesome-preact list](https://github.com/preactjs/awesome-preact) :sunglasses:\n\n---\n\n## Getting Started\n\n> 💁 _**Note:** You [don't need ES2015 to use Preact](https://github.com/developit/preact-in-es3)... but give it a try!_\n\n#### Tutorial: Building UI with Preact\n\nWith Preact, you create user interfaces by assembling trees of components and elements. Components are functions or classes that return a description of what their tree should output. These descriptions are typically written in [JSX](https://facebook.github.io/jsx/) (shown underneath), or [HTM](https://github.com/developit/htm) which leverages standard JavaScript Tagged Templates. Both syntaxes can express trees of elements with \"props\" (similar to HTML attributes) and children.\n\nTo get started using Preact, first look at the render() function. This function accepts a tree description and creates the structure described. Next, it appends this structure to a parent DOM element provided as the second argument. Future calls to render() will reuse the existing tree and update it in-place in the DOM. Internally, render() will calculate the difference from previous outputted structures in an attempt to perform as few DOM operations as possible.\n\n```js\nimport { h, render } from 'preact';\n// Tells babel to use h for JSX. It's better to configure this globally.\n// See https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#usage\n// In tsconfig you can specify this with the jsxFactory\n/** @jsx h */\n\n// create our tree and append it to document.body:\nrender(\n\t
\n\t\t

Hello

\n\t
,\n\tdocument.body\n);\n\n// update the tree in-place:\nrender(\n\t
\n\t\t

Hello World!

\n\t
,\n\tdocument.body\n);\n// ^ this second invocation of render(...) will use a single DOM call to update the text of the

\n```\n\nHooray! render() has taken our structure and output a User Interface! This approach demonstrates a simple case, but would be difficult to use as an application grows in complexity. Each change would be forced to calculate the difference between the current and updated structure for the entire application. Components can help here – by dividing the User Interface into nested Components each can calculate their difference from their mounted point. Here's an example:\n\n```js\nimport { render, h } from 'preact';\nimport { useState } from 'preact/hooks';\n\n/** @jsx h */\n\nconst App = () => {\n\tconst [input, setInput] = useState('');\n\n\treturn (\n\t\t
\n\t\t\t

Do you agree to the statement: \"Preact is awesome\"?

\n\t\t\t setInput(e.target.value)} />\n\t\t
\n\t);\n};\n\nrender(, document.body);\n```\n\n---\n\n## Sponsors\n\nBecome a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/preact#sponsor)]\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n             \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Backers\n\nSupport us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/preact#backer)]\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n---\n\n## License\n\nMIT\n\n[![Preact](https://i.imgur.com/YqCHvEW.gif)](https://preactjs.com)\n\n[preact/compat]: https://github.com/preactjs/preact/tree/main/compat\n[hyperscript]: https://github.com/dominictarr/hyperscript\n[DevTools]: https://github.com/preactjs/preact-devtools\n","homepage":"https://preactjs.com","repository":{"type":"git","url":"git+https://github.com/preactjs/preact.git"},"bugs":{"url":"https://github.com/preactjs/preact/issues"},"license":"MIT","readmeFilename":"README.md"}