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-Y5oDj5rahclwv3Y5O3zzg3UrDgPZBixjZT6H5ma1J3tF8v0mCxO4KkwQvQwE9rWLqjidyTkiTEyHK4OCd8y/eg==",
"shasum": "9e61cc69b9fe7482e3c41c1fb55f8f104bd17083",
"tarball": "https://registry.npmjs.org/1clearscientist/-/1clearscientist-1.0.51.tgz",
"fileCount": 46,
"unpackedSize": 115270,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQDIV05GgggVeSTI35PdbElrTAKzS4T5lW/1hUGJXu0ysAIge5dneEHHN/sKM6doNgvbEww2lDGA4lqtj2pEhhDj7Bo="
}
],
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYvF3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4mA//bRh8+dAeEpv/PJf87uiuMoBy8dT3H3KDxpi5f7SqGpcmIc3G\r\n7aYOqrdtAoFkPNbA+2qVGnhGTAV7pPwMROhALTd5/iObEYve0tRGO8GMcp13\r\nFvTi959u7gvoGyMdNBFKw7My/85m09CZqN31TCofLpYmtZ7UpPCu1F/B6wKw\r\nyhLxBcMCVQugcwP6q6QmKpTEaZKfzuIRJv+ukVr4gneP8Bz4QiExwrYSvLtf\r\nACQC+EaBCUbERqMfGAU8Tyvb+iUi6fYJLfUIq8e6piUsTaa4TyFA2L2XY+oj\r\n61EEbnHuEN/u7u65eaGnHnJqx8nhd9K6wlub+ZZzubCGH8IZnldCAii07tDk\r\n1tD/DCxTJ42Xkspq3iZ1TIC23NrUogij6c700B7RMMKdhx9x+kZzB6AUbVts\r\nliY3xCIb6MWe554iop9dzbMJa61zyYS+eOyeEdf7yAFQMzzHzVZLznhEitUT\r\nLspWTX2aV1nTERrOtae8TvdQTVAFAxJ9knAcBIlVKin3XGdBh4c8n1BQtbcs\r\nmUGKq/yFcQ1YOSIfNu3Y2V5sIMhz3eQLXijBkwPPq9kevtbSKVtoOJHxFsev\r\nCa3B/E+Xl42xPXF0lLDkqJ7BHw2FrROI13tBdxaHKENT90NVXHNMQFLXZaqk\r\nF5Ts5+XkuUSvLLO53ApIMhUl92jU6awQQxk=\r\n=Pf03\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:e7a23c77c0ca88ebd5363f85591eec401f93e51e07ed54f8657e5bc79ba8765d