Ưu đãi trong tuần: Nhập mã UD50 giảm 50k cho đơn từ 300k!
Trang chủ
Menu

Creating NPM packages: The Complete Guide

Tạo gói NPM: Hướng dẫn Toàn diện

Tạo gói NPM: Hướng dẫn Toàn diện

Tạo và xuất bản gói NPM có thể tree-shake của riêng bạn — kỹ năng thiết yếu mọi web developer cần có

4.8
(73 đánh giá)
533 học viên
Giảng viên
Codee Feldmann
Phụ đề Việt chất lượng cao Phụ đề tiếng Anh Bán chạy Đánh giá cao
50.000đ 349.000đ -86%
✓ Xem giỏ hàng và thanh toán
Bao gồm phụ đề tiếng Việt, tiếng Anh
5.5 giờ video
74 bài giảng
Truy cập vĩnh viễn
Học trên mọi thiết bị
Cập nhật: 30/05/2026

Bạn sẽ học được gì

Nắm vững mọi cấu hình cơ bản & nâng cao mà người tạo gói NPM phải biết
Triển khai gói hỗ trợ tree shaking (tìm hiểu sâu và thực sự hiểu khái niệm này)
Xuất bản gói NPM dễ dàng với công cụ CI tự động
Phân phối gói với nhiều hệ thống module khác nhau
Xử lý phát triển song song các phiên bản pre-release trong khi vẫn duy trì phiên bản ổn định
Tạo gói có hỗ trợ Typescript

Yêu cầu

Kiến thức cơ bản về Javascript

Đối tượng phù hợp

Dành cho mọi cấp độ Javascript developer muốn mở rộng kiến thức về gói NPM và tạo gói theo best practices

Nội dung khóa học

7 phần • 74 bài giảng
1 Giới thiệu
2 Cách nhận trợ giúp
1 Giới thiệu phần
2 Kiểm tra phiên bản Node
3 Tạo git repo cho gói
4 Tạo mã nguồn
5 Thuộc tính name trong package.json
6 Hệ thống module trong gói
7 Cập nhật quan trọng về hệ thống module
8 Thiết lập tsconfig.json
9 Cài đặt Rollup
10 Cấu hình Rollup
11 Giải thích cấu hình
12 Điểm vào của gói
13 Trường files
14 Tạo tài khoản npm
15 Xuất bản gói của chúng ta
16 Tổng kết phần
1 Giới thiệu phần
2 Cài đặt ứng dụng Vite
3 Sử dụng gói trong ứng dụng
4 Khám phá production bundle của ứng dụng
5 Gói của chúng ta được sử dụng như thế nào?
6 Ứng dụng Express
7 Cài đặt & chạy ứng dụng express
8 Sử dụng gói trong express
9 Thử nghiệm với ứng dụng express
10 Tổng kết phần
1 Giới thiệu phần
2 Changesets action
3 Semantic versioning
4 Khởi tạo changesets
5 Viết github workflow
6 Giải thích workflow
7 Tạo Github token
8 Tạo NPM token
9 Xuất bản với changesets
10 Xử lý nhiều tác vụ với changesets
11 Tổng kết phần
1 Giới thiệu phần
2 Liên kết gói của chúng ta
3 Cơ chế hoạt động của npm link
4 Lập kế hoạch pre-release
5 Vào chế độ pre-release
6 Làm việc song song
7 Xuất bản phiên bản pre-release đầu tiên
8 Sử dụng phiên bản pre-release
9 Làm việc song song trên bản phát hành thông thường
10 Sử dụng bản phát hành thông thường
11 Nâng cấp pre-release tag của chúng ta
12 Phát hành phiên bản major tiếp theo
13 Thử nghiệm phiên bản major mới
14 Tổng kết phần
1 Giới thiệu phần
2 Giải thích tree shaking
3 Mã gói components
4 Tạo git repo cho gói mới
5 Khám phá mã nguồn gói
6 Chuẩn bị xuất bản
7 Tạo github token
8 Tạo npm token
9 Xuất bản gói components
10 Sử dụng gói mới của chúng ta
11 Gói của chúng ta có tree-shakable không?
12 Điều kiện đầu tiên cho gói tree-shakable
13 Gói NPM và side effects
14 Cách tối ưu hóa với side effects
15 Gói được build với typescript
16 Một lỗi chính tả nhỏ
17 Xuất bản gói tree-shakable của chúng ta
18 Kiểm tra xem gói có tree-shakable không
19 Một bí ẩn nữa cần giải quyết
20 Tổng kết phần
1 Chúc mừng

Giới thiệu khóa học

NPM packages are the most popular and powerful way today for making your code reusable and share it between various projects. But as most of us are starting to code for the web by developing web applications, when the time comes and we need to create and publish our own first NPM package, we find ourselfs guessing what are the best practices we should follow

That's what happened to me a few years ago when I was required to create my first NPM package. I tried to search for some detailed tutorial or an in-depth course to guide me, but pretty soon I realized such source doesn't really exist. So I started gathering the knowledge through endless blog posts, short tutorials, friends, colleagues and mainly a lot of exploring and experimenting I did on my own.

Years later, I'm really happy to publish this course and share the knowledge I accumulated during all this time. One of the main purposes of doing so, is to make your journey with NPM packages much easier and pleasant. So I hope you will enjoy this ride of learning and start implementing your own amazing NPM packages

This course will start from the basic stuff regarding NPM packages and then continue to the most advanced topics it involves

You will learn the basic structure of an NPM package, all the configurations involved in creating it, and of course the various properties that the package json file should include. We will experiment with our newly created package, ship it with different module systems, develop it with full typescript support and see the differences between consuming it through frontend and backend applications. We will then learn how we can automate the process of versioning and publishing the package, with some of the most popular and exciting CI tools. Pre-releases will also be on the menu, and we will learn some techniques that will enable us to publish pre-release versions while maintaining our current stable version. We will test various ways of building our packages, and of course, we will take a deep dive into the interesting topic of tree shaking, where we will see live examples and reveal all the behind the scenes of it.

After this course you will feel confident regarding your ability to create NPM packages with best practices, and you will have the tools to debug the behavior of your package and adjust its configurations according to your needs

I hope you will have a great experience during our time together, and wish you will soon start to implement your own creative ideas for your popular, brand-new, NPM package

Khóa học liên quan

Khám phá thêm các khoá học cùng chủ đề

Hiển thị tất cả khoá học Javascript
Hiển thị tất cả khoá học Node Js
Hiển thị tất cả khoá học Web Development
Zalo
Tôi có thể tư vấn khoá học cho bạn 😊