https://github.com/5h1ngy/bl-rollup-node-javascript
A modern boilerplate for Node.js libraries with JavaScript and Rollup. Perfect for creating optimized JavaScript packages ready for distribution.
https://github.com/5h1ngy/bl-rollup-node-javascript
bundler documentation es-modules javascript library node npm-package offline-first rollup
Last synced: 6 months ago
JSON representation
A modern boilerplate for Node.js libraries with JavaScript and Rollup. Perfect for creating optimized JavaScript packages ready for distribution.
- Host: GitHub
- URL: https://github.com/5h1ngy/bl-rollup-node-javascript
- Owner: 5h1ngy
- Created: 2025-04-01T02:43:46.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-01T03:09:57.000Z (6 months ago)
- Last Synced: 2025-04-01T04:21:43.353Z (6 months ago)
- Topics: bundler, documentation, es-modules, javascript, library, node, npm-package, offline-first, rollup
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Rollup



A modern boilerplate for Node.js libraries with JavaScript and Rollup. Perfect for creating optimized JavaScript packages ready for distribution.
**Topics:** `node` `javascript` `rollup` `library` `npm-package` `bundler` `es-modules` `offline-first` `documentation`
## ๐ Table of Contents
- [Features](#-features)
- [Project Structure](#-project-structure)
- [Project Setup](#-project-setup)
- [Development](#-development)
- [Build](#-build)
- [Package Managers](#-package-managers)
- [Resources](#-resources)## โจ Features
- ๐ฆ Optimized bundling with Rollup
- ๐ JavaScript linting with ESLint
- ๐จ Code formatting with Prettier
- ๐งช Testing with Jest
- ๐ค Support for ES Modules import/export
- ๐พ 100% offline functionality
- ๐ Support for hot-reload during development
- ๐ Tools for documentation generation
- ๐ง Babel configuration for modern JavaScript## ๐๏ธ Project Structure
```
bl-rollup-node-javascript/
โโโ dist/ # Output directory for the bundle
โโโ src/ # JavaScript source code
โ โโโ index.js # Main entry point
โ โโโ lib/ # Library modules and functionality
โโโ test/ # Test files
โโโ .eslintrc # ESLint configuration
โโโ rollup.config.js # Rollup configuration
โโโ jest.config.js # Jest configuration
โโโ babel.config.js # Babel configuration
โโโ package.json # Project dependencies and scripts
```## ๐ Project Setup
### ๐ฅ Install
```bash
$ pnpm install
```## ๐ง Development
```bash
$ pnpm dev
```## ๐ฆ Build
```bash
$ pnpm build
```## ๐ฆ Package Managers
This project supports multiple package managers. Here's how to use each one:
### NPM
NPM is the default package manager for Node.js.
**Install NPM:**
```bash
# Included with Node.js installation
```**Setup project with NPM:**
```bash
# Install dependencies
$ npm install# Development mode
$ npm run dev# Build the library
$ npm run build
```**Key features:**
- ๐ Vast package ecosystem
- ๐ Hierarchical node_modules structure
- ๐ Package.json for dependency management### Yarn
Yarn is a fast, reliable, and secure alternative to NPM.
**Install Yarn:**
```bash
# Install using NPM
$ npm install -g yarn
```**Setup project with Yarn:**
```bash
# Install dependencies
$ yarn# Development mode
$ yarn dev# Build the library
$ yarn build
```**Key features:**
- โก Faster installation speeds
- ๐ฆ Offline caching
- ๐ Better security with checksums
- ๐ yarn.lock for deterministic installations### PNPM
PNPM is a disk-space efficient package manager.
**Install PNPM:**
```bash
# Install using NPM
$ npm install -g pnpm
```**Setup project with PNPM:**
```bash
# Install dependencies
$ pnpm install# Development mode
$ pnpm dev# Build the library
$ pnpm build
```**Key features:**
- ๐พ Disk space savings through symlinks
- ๐ Fast installation speeds
- ๐ Content-addressable storage
- ๐ pnpm-lock.yaml for dependency lock### Comparison
| Feature | NPM | Yarn | PNPM |
|-----------------------|---------|---------|---------|
| Disk usage | High | High | Low |
| Installation speed | Slow | Fast | Fastest |
| Parallel installations| Limited | Yes | Yes |
| Workspace support | Limited | Good | Best |
| Offline mode | Limited | Good | Good |
| Security | Good | Better | Better |## ๐ Resources
- [Node.js Documentation](https://nodejs.org/en/docs/)
- [JavaScript MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
- [Rollup Documentation](https://rollupjs.org/guide/en/)
- [NPM Documentation](https://docs.npmjs.com/)
- [Yarn Documentation](https://yarnpkg.com/getting-started)
- [PNPM Documentation](https://pnpm.io/motivation)