Observed since 20 Oct, 18:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
1clearscientist
A demo for publishing cool packages to npm registry
All you need to know for publishing a React or any JavaScript component/hook to NPM registry.
If you want to test this package, run
npm i my-cool-package-name
Clone this Repo.
Modify /src
folder or overwrite
index.js according to your package's need.
Install all Dependencies by running:
npm install
npm run build
Login into to your NPM account using terminal/cmd.
Publish it
npm publish
/src/index.js
In Index.js just add prop type others are exactly same.
import React from 'react'
import PropTypes from "prop-types"
function MyPackage(props) {
return (
<div>
<h3>Hello {props.name}</h3>
<p>I hope this helped you :)</p>
</div>
)
}
MyPackage.propTypes = {
name: PropTypes.string
};
export default MyPackage
package.json
In package.json file, we changed the "main" and webpack build script.
{
"name": "my-cool-package-name",
"version": "1.0.0",
"description": "A demo for publishing cool packages to npm registry",
"main": "./build/index.js",
"scripts": {
"build": "webpack"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rohitsaini1196/npm-publish-boilerplate.git"
},
"keywords": [
"npm",
"publish",
"reactjs",
"es6",
"package"
],
"author": "Rohit Saini",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.7.5",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"babel-loader": "^8.0.6",
"css-loader": "^3.3.0",
"style-loader": "^1.0.1",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
},
"dependencies": {
"prop-types": "^15.7.2",
"react": "^16.12.0"
},
"bugs": {
"url": "https://github.com/rohitsaini1196/npm-publish-boilerplate/issues"
},
"homepage": "https://github.com/rohitsaini1196/npm-publish-boilerplate#readme"
}
Ask me if you have any doubt.
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
Source distribution
{
"integrity": "sha512-/ZkujjNepxPpfJm4R/jKc85/dG/Mx49Q4mWwiOg/K1aM08n40wd3kUTJv5Z+DkijuBxYviKLS3fxc5puM/dkzg==",
"shasum": "b01822205b658d8db47f793bdc6211416478a529",
"tarball": "https://registry.npmjs.org/1clearscientist/-/1clearscientist-1.0.4.tgz",
"fileCount": 5,
"unpackedSize": 23709,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEQCIDUmYlRl06lbAahmCEJwj26lHuf7dObdaX0bt7s1AwDcAiBPK2Inci69gVFVorBFXMwP6/sztXslTlxdDENwOSsSPg=="
}
],
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYvBoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQBxAAmVFsi5icuhU25WuKkPkd9cg8Hf4vMBREUgXp9UBncbc4TIMX\r\nbtBttDFKHuoglyEv/BZGTlfeOFTG2FYYSgAEXXJkZ1MxAaSwB3x13vGLk/va\r\nAhtsUA8xq4z/0ptnA54187rno/w95MJKQOjN0z3Mub8pYvoRycFrRgNjBkGR\r\nfkyOK5F6BgDSSiTbVtjYoHspOI5ZKq5/V8GCZpAD67GJx23OO74m93MEQWmQ\r\ntJlwVUc8XSw/gKHj+Dxcqd00mcVRFSRT0sT2GlKFbPoRZaIi/JRJvtVmyhVD\r\nDb+bjuoDL/82K5MFWCXorvsltRTzCOu8FwhNadb1PUAyd1Rr5+yD1wgJo8az\r\n8OQ/u0fPq1Tsbtxqzq9rRJH3R+ivyydPzZg7JZ9pBFgHft2INJL679onYfkp\r\nsNEgAEnTs+rc1aZFt9eiXchlKjXCKT1Vw7SLN6eHtDIMooTNVSM32VP+/j1G\r\npwEEE5ybDzMUtw1J4WMv79HkgiasjAsaUxd5oz9FM+WTfXhx6ZNyiPW1ZPfs\r\nhuVgkuAJJWZdIlzwGMaR7FYynpd8easgFMoNx7aO5B9zqpO/z3jYZSeBoSA2\r\nMg0LK9+8JxhtQzuyFUIdAt8b13jdzYB9hYzmiFk18oKgZGMiw8ht/hFIML9i\r\nGEU8+3zRTpxxecnoaWOCHc7SJD6sWnfPpnU=\r\n=+Gcg\r\n-----END PGP SIGNATURE-----\r\n"
}Shared repository data · GitHub
Observed since 20 Oct, 18:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:753c54f222ba7f2688177b4b5df82fa6dc61328522f8aeca728ecfacf54904a2