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

Поділитися
Вставка
  • Опубліковано 18 жов 2024

КОМЕНТАРІ • 59

  • @DarlenCodename
    @DarlenCodename 7 місяців тому +24

    Awesome quality video.
    ✅ Perfect audio.
    ✅ Straight to the point.
    ✅ Showing best practices.
    Keep it up.

  • @weroro
    @weroro 11 місяців тому +10

    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 7 місяців тому +2

      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

  • @TheFearlessStudios
    @TheFearlessStudios Рік тому +2

    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 10 місяців тому +1

    Best video I've watched on how to create npm package!!

  • @ZeroCommentsZeroDocs7Bugs
    @ZeroCommentsZeroDocs7Bugs 5 місяців тому

    From all the tutorials this was the one that got me to where I wanted to be! Thank you so much!

  • @PlatinumBuckGorilla
    @PlatinumBuckGorilla 3 місяці тому +2

    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.

  • @priyanshushh
    @priyanshushh 6 місяців тому

    Thank you so much dude today i published my first ever package, this video helped me a lot.

  • @PRABHAKARNAYAK-s5v
    @PRABHAKARNAYAK-s5v 10 днів тому

    Thank you for the clear explanation

  • @hghlndr2
    @hghlndr2 4 місяці тому

    Wow! What a good video!!! Best one for this subject, hands down.

  • @TheBenhichem
    @TheBenhichem 3 місяці тому

    nice, simple and straight forward

  • @v.demchenko
    @v.demchenko 3 місяці тому

    absolutely amazing video with great explanation every detail

  • @XZivXL
    @XZivXL 7 місяців тому

    Life saver! Thank you for that

  • @abdulsamadayoade9439
    @abdulsamadayoade9439 4 місяці тому

    thanks for making this, it fixed my problem

  • @mariolazzari
    @mariolazzari 5 місяців тому

    amazing video: I was seaarching for a tsdx alternative and, thanks to your awesome job, I found it!

  • @WaveFlightSimulations
    @WaveFlightSimulations Місяць тому

    thanks for the video bro

  • @RabahTaib-mn4fs
    @RabahTaib-mn4fs 6 місяців тому

    Frist: (الحمد لله)
    Second: Thank you ♥

  • @BooksWeCanRead
    @BooksWeCanRead Рік тому +1

    That’s so cool! Thanks so much that’s awesome! 👌

  • @nayandey5010
    @nayandey5010 9 місяців тому

    thanks to you, for my first npm package

  • @douglasemsantos
    @douglasemsantos 6 місяців тому

    Excellent video! Thank you for that!

  • @tegasteve8195
    @tegasteve8195 8 місяців тому

    Thanks so much This was really helpful for my SAAS

    • @UnderCtrl
      @UnderCtrl  8 місяців тому

      Glad to have been helpful. Good luck on your SaaS! :)

  • @zoeycvu
    @zoeycvu 7 місяців тому

    thank you for your best tutorial

  • @antonhogstrom4085
    @antonhogstrom4085 10 місяців тому

    Great quality tutorials! 👌

  • @m1dev
    @m1dev Рік тому +1

    Great video! ❤🔥

  • @0looom
    @0looom Рік тому +1

    keep going!!!!!!!!!!!!!!!!!!!!

  • @aboutreactnative4484
    @aboutreactnative4484 9 місяців тому

    Thanks for the tutorial I have made a npm package called log-glow

  • @qudratullahkhan4518
    @qudratullahkhan4518 3 місяці тому

    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?

  • @webdevelopmentguide4910
    @webdevelopmentguide4910 2 місяці тому

    Thankful

  • @mayurghuge8846
    @mayurghuge8846 3 місяці тому

    Thank you.

  • @hidhayaths
    @hidhayaths 3 місяці тому

    Excellent! Can we do classes in ts with the same steps or do we need any other configs? Pls advise

    • @UnderCtrl
      @UnderCtrl  3 місяці тому

      You can use the same config for classes

  • @anilsonix
    @anilsonix 9 місяців тому

    Could also share how to build isomorphic packages and subpath exports 😊

  • @rjwhite4424
    @rjwhite4424 5 місяців тому

    awesome video. How would you recommend testing the code before building and publishing?

    • @UnderCtrl
      @UnderCtrl  5 місяців тому

      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

  • @mrlectus
    @mrlectus 2 місяці тому

    Why do I have to install types in some package and some I don't have to, but they still have types?

  • @zenobiusztasak8604
    @zenobiusztasak8604 7 місяців тому

    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

  • @tech-nomade
    @tech-nomade 4 місяці тому

    bro this is gold. subsicribed

  • @maxpricefield7586
    @maxpricefield7586 8 місяців тому

    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  8 місяців тому +1

      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.

  • @devgauravjatt
    @devgauravjatt 9 місяців тому

    Great video 💯❤❤❤🎉🎉🎉🎉🎉

  • @praweewongsa
    @praweewongsa 8 місяців тому

    good job

  • @kasuutooheri
    @kasuutooheri Рік тому +1

    Podrias hacer un tutorial para embeds programados?):

  • @gayathri-8-i6s
    @gayathri-8-i6s 6 місяців тому

    as i am using next js, i dont have main. then how to do it?

  • @heruhailiuhuang533
    @heruhailiuhuang533 8 місяців тому

    how to build for diff env like and prod.

  • @yunwang1243
    @yunwang1243 7 місяців тому +3

    Why is it for CommonJS? It is outdated

  • @ftntio
    @ftntio Рік тому

    Cool....

  • @jh_developer
    @jh_developer 5 місяців тому

    package npm adduser notworking?

    • @abdulsamadayoade9439
      @abdulsamadayoade9439 4 місяці тому

      don't add package, that is his folder name used in the tutorial, just type "npm add user"

  • @FaresFakhouri
    @FaresFakhouri Рік тому +1

    How To Make Dashboard #Day 1

  • @reybecar8033
    @reybecar8033 6 місяців тому +1

    I’m so lost at the beginning

    • @kobbimensah547
      @kobbimensah547 4 місяці тому

      Don't worry things gets so complicated when you don't know to start from

    • @PlatinumBuckGorilla
      @PlatinumBuckGorilla 3 місяці тому

      Fairly easy tutorial considering you do minimal compared to if you were using webpack or rollup

    • @ehm-wg8pd
      @ehm-wg8pd 2 місяці тому

      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)

  • @sanjay-gf9pr
    @sanjay-gf9pr 3 місяці тому +1

    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"]
    }