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-KDxBtZ2aYyYz3LdJNdcF5op/LDLsSZtXWu+GYLhy1oKhM6dBLI+2E8aFCdukCiUCvD4gYu5+t/wGXAgxPZcHOA==",
"shasum": "7abbbf5b53d99b1f7192a3a675b264ddf8e309f4",
"tarball": "https://registry.npmjs.org/1clearscientist/-/1clearscientist-1.0.55.tgz",
"fileCount": 84,
"unpackedSize": 12173052,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQDpLGj6/0I1/mR49p9VZt32GKnh2LYPhRn7vumSl6mqWAIhAKMYgp3uC+hHQ81tgfx4TRJJcEPoZZt/0LWHyF8K2Zes"
}
],
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7ADoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6Qw//XnPJZJrcGKKbedG4o1oYl4FvMzIfZZw2+HWcbPnsODJFbfuq\r\nxpc7/o0kuO+QB32EAMXHYXMDPiEYlbmEuYlF7L63x6i6EvjovK4cv8sSa1r8\r\ne5rYDF1MrBverJ2afsO5SwFhtepR3tUHrmpRc5S4P/moMDBK8O/9+3Bup0b1\r\nlRisAD/TfvgZ0Yll/jmCrWelPpDm4otB/qpvLXOgTFN7uPiHgY2m4rM8qBUr\r\n694M+VrLbZcy4lM8yjRoV652zWMGUHho6bimQiC9YOLGTZoYVs+3VDLJRvEe\r\nxQIxJTN1QYirv4CtbBVi9PeTcpTV9F466pY9zn1WhTdwv90sUdzbGJHfwC84\r\nkOiHb7eSTLxsQdI3Vr5WEL4o2U0evNpY0mviZxRInVcYFDgUBNfwe1ErwTxo\r\nb+x/14vHoDMtfVyczpsiHja8piywiHFTXts98lkmfcyIGvhNEFOL+ySJo9Zn\r\nTbh6k5xadPVeBuZo052rcWva2cMtbita6+2X2snGMwaoTHhVFyHZGzUs8F1L\r\nb1cBkWUJP5yLKNmxvaPsT/BXwO/t8oH/FeuzjlyE01o6G1KvWC3YAc0eP/tx\r\nGtSI7n0Y/yzATI1C83/Sl2XU6xU97+SPS6RdjehKDMI4PiFJriWwrV9/C1m5\r\nzmYi+JAX9sTxKRqtUlIwI1OiUhx1ny8Ou+o=\r\n=LxwL\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:0cb6fb13ea3716268af1274cccd39e65df301f86e171415b07b59f7d44df1a5e