How to make your own NPM package (Step-by-Step) 📦

  Рет қаралды 21,553

Under Ctrl

Under Ctrl

Күн бұрын

How to make your own NPM package (Step-by-Step) 📦
🧠 Resources
tsconfig.json: pastebin.com/NT2Z7Kas
tsup.config.ts: pastebin.com/m7bGKx0d
🌐 Important links
Discord: ctrl.lol/discord
Github: github.com/notunderctrl
Patreon: / underctrl
Buy me a coffee (one-time donation): buymeacoffee.com/underctrl
🕐 Timestamps
00:00 - Introduction
00:32 - Setting up npm account
00:49 - Authenticating terminal with npm
01:28 - Setting up npm project
04:29 - Installing dependencies
05:11 - Configuring TypeScript
06:14 - Configuring TSUP
07:06 - Configuring scripts
08:04 - Setting up project structure
11:34 - Transpiling TypeScript code
12:00 - Ignoring files for GitHub and npm
13:40 - Creating README.md
15:16 - Pushing code to npm
16:32 - Conclusion

Пікірлер: 44
@DarlenCodename
@DarlenCodename 3 ай бұрын
Awesome quality video. ✅ Perfect audio. ✅ Straight to the point. ✅ Showing best practices. Keep it up.
@TheFearlessStudios
@TheFearlessStudios 8 ай бұрын
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
@jasonko1202
@jasonko1202 6 ай бұрын
Best video I've watched on how to create npm package!!
@ZeroCommentsZeroDocs7Bugs
@ZeroCommentsZeroDocs7Bugs Ай бұрын
From all the tutorials this was the one that got me to where I wanted to be! Thank you so much!
@nayandey5010
@nayandey5010 5 ай бұрын
thanks to you, for my first npm package
@weroro
@weroro 7 ай бұрын
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
@DarlenCodename
@DarlenCodename 3 ай бұрын
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
@antonhogstrom4085
@antonhogstrom4085 6 ай бұрын
Great quality tutorials! 👌
@hghlndr2
@hghlndr2 19 күн бұрын
Wow! What a good video!!! Best one for this subject, hands down.
@BooksWeCanRead
@BooksWeCanRead 8 ай бұрын
That’s so cool! Thanks so much that’s awesome! 👌
@douglasemsantos
@douglasemsantos 2 ай бұрын
Excellent video! Thank you for that!
@m1dev
@m1dev 8 ай бұрын
Great video! ❤🔥
@priyanshushh
@priyanshushh 2 ай бұрын
Thank you so much dude today i published my first ever package, this video helped me a lot.
@abdulsamadayoade9439
@abdulsamadayoade9439 Ай бұрын
thanks for making this, it fixed my problem
@XZivXL
@XZivXL 3 ай бұрын
Life saver! Thank you for that
@zoeycvu
@zoeycvu 3 ай бұрын
thank you for your best tutorial
@0looom
@0looom 8 ай бұрын
keep going!!!!!!!!!!!!!!!!!!!!
@tegasteve8195
@tegasteve8195 5 ай бұрын
Thanks so much This was really helpful for my SAAS
@UnderCtrl
@UnderCtrl 5 ай бұрын
Glad to have been helpful. Good luck on your SaaS! :)
@RabahTaib-mn4fs
@RabahTaib-mn4fs 2 ай бұрын
Frist: (الحمد لله) Second: Thank you ♥
@mayurghuge8846
@mayurghuge8846 3 күн бұрын
Thank you.
@aboutreactnative4484
@aboutreactnative4484 5 ай бұрын
Thanks for the tutorial I have made a npm package called log-glow
@devgauravjatt
@devgauravjatt 6 ай бұрын
Great video 💯❤❤❤🎉🎉🎉🎉🎉
@tech-nomade
@tech-nomade Ай бұрын
bro this is gold. subsicribed
@praweewongsa
@praweewongsa 4 ай бұрын
good job
@anilsonix
@anilsonix 5 ай бұрын
Could also share how to build isomorphic packages and subpath exports 😊
@rjwhite4424
@rjwhite4424 Ай бұрын
awesome video. How would you recommend testing the code before building and publishing?
@UnderCtrl
@UnderCtrl Ай бұрын
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
@gayathridevip4632
@gayathridevip4632 3 ай бұрын
as i am using next js, i dont have main. then how to do it?
@maxpricefield7586
@maxpricefield7586 4 ай бұрын
question: do we need to configure for both cjs and esm if I just want to make typescript libraries meant for nodeJS only?
@UnderCtrl
@UnderCtrl 4 ай бұрын
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.
@kasuutooheri
@kasuutooheri 8 ай бұрын
Podrias hacer un tutorial para embeds programados?):
@USSEnterprise
@USSEnterprise 8 ай бұрын
Cool....
@zenobiusztasak8604
@zenobiusztasak8604 3 ай бұрын
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
@heruhailiuhuang533
@heruhailiuhuang533 4 ай бұрын
how to build for diff env like and prod.
@jh_developer
@jh_developer 2 ай бұрын
package npm adduser notworking?
@abdulsamadayoade9439
@abdulsamadayoade9439 Ай бұрын
don't add package, that is his folder name used in the tutorial, just type "npm add user"
@FaresFakhouri
@FaresFakhouri 8 ай бұрын
How To Make Dashboard #Day 1
@yunwang1243
@yunwang1243 3 ай бұрын
Why is it for CommonJS? It is outdated
@hrushikeshvibhute4639
@hrushikeshvibhute4639 2 ай бұрын
Node js works on common js only
@goat-sama
@goat-sama 2 ай бұрын
Did a bot write this?
@reybecar8033
@reybecar8033 2 ай бұрын
I’m so lost at the beginning
@kobbimensah547
@kobbimensah547 7 күн бұрын
Don't worry things gets so complicated when you don't know to start from
@mariolazzari
@mariolazzari Ай бұрын
amazing video: I was seaarching for a tsdx alternative and, thanks to your awesome job, I found it!
Build And Publish A React Component Library
24:02
PortEXE
Рет қаралды 99 М.
Каха ограбил банк
01:00
К-Media
Рет қаралды 9 МЛН
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 20 МЛН
How to Create an NPM Package | JavaScript | React | Nextjs
51:31
Njoku Samson Ebere
Рет қаралды 398
Creating Your Own UI Library with React and TypeScript
6:04
Bayan Bennett
Рет қаралды 24 М.
It's Time To Talk About This Tailwind Plugin
7:26
Josh tried coding
Рет қаралды 41 М.
Publish Your NPM Package & Get Job 🔥 - Here's how
40:54
6 Pack Programmer
Рет қаралды 27 М.
How to Make a Javascript Library - Building With Typescript & Publish
17:50
Monsterlessons Academy
Рет қаралды 16 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
How to Create and Publish a React Component Library
1:19:25
Alex Eagleson
Рет қаралды 76 М.