A lightweight, **pure JavaScript** utility to print HTML elements by ID — with full support for structured layouts including header, content, and footer.
npm install easy-print-jsbash
npm install easy-print-js
or
yarn add easy-print-js
or
pnpm add easy-print-js
`
---
⚡ Quick Usage
> You can use this package in plain HTML/JS or any framework like Vue, React, Angular, etc.
---
$3
`vue
`
---
🔧 API
$3
| Option | Type | Required | Description |
|--------------------|----------|----------|------------------------------------------------|
| contentElementId | string | ✅ | The ID of the main body content element |
| headerElementId | string | ❌ | Optional element to show at the top of print |
| footerElementId | string | ❌ | Optional element to show at the bottom |
> The elements are cloned and inserted into a print-specific structure using , , and .
---
📝 License
MIT © Ali Hassan
---
🔗 Repository
GitHub: https://github.com/alihdev/easy-print-js
> ⭐ If you find this project useful, give it a star on GitHub — it helps others discover it!
---
🤝 Contributing
Contributions are welcome! If you find bugs, have suggestions, or want to add a new feature, feel free to:
1. Fork the repository
2. Create a new branch (git checkout -b feature/my-feature)
3. Commit your changes (git commit -am 'Add new feature')
4. Push to the branch (git push origin feature/my-feature`)