5:14 There is a CLI for that "npx tsc --init" 15:30 Before publishing a new package, you should test it locally. Use the "npm pack" command to create a TGZ file and you can use it in the package.json file using the "npm install relative_path_to_package_file" command
I really appreciate this video as I’m gonna be making a discord game package and this helped me understand things I didn’t understand before keep up the great work
Everyting on point. Very good tutorial. Saved me a lot of time. Been fluffing around with webpack and it’s plug-ins especially the ts-loader the bloody things are so out of sync. Spent countless hours trying to find compatible versions between the two.
Amazing bro. Subbed One thing tho, you often don't need to install packages globally, if you install them as a dev dependency you can use its binary inside that project via npx
How instead of this: import {Button, someFunction} form "my-package" have these separated like: import {Button} from "my-package/components" import {someFunction} from "my-package" or "my-package/functions" Thanks
The package.json is supposed to be outside the dist directory and meant to be used by package managers/node to determine where your build is (commonly in dist)
You can use "npm link" to install this package locally in another project and test it out there. I found this great tutorial you might find helpful: dev.to/one-beyond/different-approaches-to-testing-your-own-packages-locally-npm-link-4hoj
Yes, it would be good practice to do so because some developers might use CommonJS with your library while others might use ESM. Configuring for both ensures that your library will be supported by both environments.
if you are lost, chances are you are missing the prerequisite, developing npm library is advanced topic, you can learn javascript, typescript, module system, node, and get used with web development first (coz modern dev will give yoh insight to why npm library exist / can be helpful)
Awesome quality video.
✅ Perfect audio.
✅ Straight to the point.
✅ Showing best practices.
Keep it up.
Nothing about this was under control. this whole video was on fire 🔥-- excellent job bro! I learned a lot here
5:14 There is a CLI for that "npx tsc --init"
15:30 Before publishing a new package, you should test it locally. Use the "npm pack" command to create a TGZ file and you can use it in the package.json file using the "npm install relative_path_to_package_file" command
You can use "npm link" to link the package globally, then in a new folder you use "npm link package-name" and it'll be linked to you node_modules
I really appreciate this video as I’m gonna be making a discord game package and this helped me understand things I didn’t understand before keep up the great work
Best video I've watched on how to create npm package!!
From all the tutorials this was the one that got me to where I wanted to be! Thank you so much!
Thank you so much dude today i published my first ever package, this video helped me a lot.
Wow! What a good video!!! Best one for this subject, hands down.
Everyting on point. Very good tutorial.
Saved me a lot of time. Been fluffing around with webpack and it’s plug-ins especially the ts-loader the bloody things are so out of sync.
Spent countless hours trying to find compatible versions between the two.
Amazing bro. Subbed
One thing tho, you often don't need to install packages globally, if you install them as a dev dependency you can use its binary inside that project via npx
nice, simple and straight forward
absolutely amazing video with great explanation every detail
🙏
thanks for making this, it fixed my problem
thanks to you, for my first npm package
That’s so cool! Thanks so much that’s awesome! 👌
Thank you for the clear explanation
Thanks so much This was really helpful for my SAAS
Glad to have been helpful. Good luck on your SaaS! :)
Excellent video! Thank you for that!
Life saver! Thank you for that
thank you for your best tutorial
How instead of this:
import {Button, someFunction} form "my-package"
have these separated like:
import {Button} from "my-package/components"
import {someFunction} from "my-package" or "my-package/functions"
Thanks
amazing video: I was seaarching for a tsdx alternative and, thanks to your awesome job, I found it!
Great quality tutorials! 👌
Great video! ❤🔥
Frist: (الحمد لله)
Second: Thank you ♥
thanks for the video bro
Thanks a lot!
Can we use HTML And CSS together to build npm packages
keep going!!!!!!!!!!!!!!!!!!!!
Very Informative video.
I have a question, this package is for Node Js. But how can we create a Vanilla JavaScript library like moment.js?
Excellent! Can we do classes in ts with the same steps or do we need any other configs? Pls advise
You can use the same config for classes
Why do I have to install types in some package and some I don't have to, but they still have types?
seems this tsup is not copying package.json file to final bundle dist, do you know why ?
The package.json is supposed to be outside the dist directory and meant to be used by package managers/node to determine where your build is (commonly in dist)
Can we create private with license key?
awesome video. How would you recommend testing the code before building and publishing?
You can use "npm link" to install this package locally in another project and test it out there. I found this great tutorial you might find helpful: dev.to/one-beyond/different-approaches-to-testing-your-own-packages-locally-npm-link-4hoj
Thanks for the tutorial I have made a npm package called log-glow
question: do we need to configure for both cjs and esm if I just want to make typescript libraries meant for nodeJS only?
Yes, it would be good practice to do so because some developers might use CommonJS with your library while others might use ESM. Configuring for both ensures that your library will be supported by both environments.
Why is it for CommonJS? It is outdated
Node js works on common js only
Did a bot write this?
True pre node16
Great video 💯❤❤❤🎉🎉🎉🎉🎉
Could also share how to build isomorphic packages and subpath exports 😊
Thank you.
Thankful
bro this is gold. subsicribed
Podrias hacer un tutorial para embeds programados?):
as i am using next js, i dont have main. then how to do it?
Means
good job
package npm adduser notworking?
don't add package, that is his folder name used in the tutorial, just type "npm add user"
how to build for diff env like and prod.
Cool....
I’m so lost at the beginning
Don't worry things gets so complicated when you don't know to start from
Fairly easy tutorial considering you do minimal compared to if you were using webpack or rollup
if you are lost, chances are you are missing the prerequisite, developing npm library is advanced topic, you can learn javascript, typescript, module system, node, and get used with web development first (coz modern dev will give yoh insight to why npm library exist / can be helpful)
How To Make Dashboard #Day 1
guess what's my name
?
import {defineConfig} from 'tsup'
export default defineConfig({
format: ['cjs', 'esm'],
entry: ['./src/index.ts'],
dts: true,
shims: true,
skipNodeModulesBundle: true,
clean: true,
})
and
{
"compilerOptions": {
"target": "es2022",
"module": "commonjs",
"outDir": "dist",
"declaration": true,
"noEmit": true,
"isolatedModules": true,
"esModuleInterop": true,
"moduleResolution": "Node",
/* Type Checking */
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
},
"include": ["src"],
"exclude": ["node_modules"]
}