Skip to content

Commit 7b98795

Browse files
Refactor code structure for improved readability and maintainability
1 parent 029b12e commit 7b98795

File tree

3 files changed

+86
-62
lines changed

3 files changed

+86
-62
lines changed

README.md

Lines changed: 85 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
# Webdev Power Kit 🚀
1+
<p align="center">
2+
<img src="./webdev logo long.png" width="500" alt="WebDev Power Kit Logo" />
3+
4+
</p>
5+
6+
<h1 align="center">🚀 WebDev Power Kit</h1>
7+
8+
<p align="center">
9+
A powerful, modular toolkit that simplifies working with browser APIs, utility tools, and system-level features — built for modern web developers. ⚡
10+
</p>
11+
212

313
[![NPM Version](https://img.shields.io/npm/v/webdev-power-kit?color=blue&label=npm%20version)](https://www.npmjs.com/package/webdev-power-kit)
414
[![Downloads](https://img.shields.io/npm/dt/webdev-power-kit?color=green&label=downloads)](https://www.npmjs.com/package/webdev-power-kit)
@@ -7,40 +17,56 @@
717
[![Made by Aditya](https://img.shields.io/badge/made%20by-Aditya%20Kumar%20Gupta-blueviolet)](https://github.com/dev-aditya-lab)
818

919

10-
A modular toolkit that brings powerful browser APIs to your fingertips. With a simple import, you can access clipboard, notifications, battery status, geolocation, network info, dark mode, vibration, and more—no boilerplate, no fuss.
11-
1220
---
1321

14-
## 🔍 Short Description
22+
## 📦 About the Project
23+
24+
**WebDev Power Kit** is a TypeScript-powered, modular toolkit designed to make common browser tasks and utility features incredibly simple and developer-friendly.
25+
26+
Whether you're building SPAs, dashboards, dev tools, or internal tools — this package saves you from writing repetitive, error-prone code.
1527

1628
Write clean, future-ready web apps with ease using modern browser features in just one line of code:
1729

18-
```js
19-
import { copyToClipboard, sendNotification, isOnline } from 'webdev-power-kit';
20-
````
30+
### ✨ Highlights
31+
32+
***Modular Structure** — only import what you need
33+
* 🧠 **TypeScript Support** — 100% typed with full JSDoc comments
34+
* ⚛️ **React-friendly** — examples included for React developers
35+
* 🌐 **Browser API Wrappers** — safe, clean functions for real-world apps
36+
* 🔌 **System Utilities** — OTPs, UUIDs, performance, and more
37+
* 🧪 **Well-tested** — secure, production-ready utilities
38+
39+
---
40+
41+
42+
## 📖 Documentation
43+
44+
45+
Explore detailed guides, feature docs, and examples in the docs section:
2146

47+
👉 [View Full Documentation](https://webdev-power-kit.hashnode.dev/docs/introduction)
2248

23-
## 📌 Introduction
49+
**Structure Includes:**
2450

25-
Webdev Power Kit is a TypeScript-powered library built for web developers who want to leverage browser features without spending time on repetitive setup. Whether you’re building projects, teaching, or just experimenting, this toolkit offers:
51+
* ✨ Features
52+
* 📥 Parameters
53+
* 🔁 Return values
54+
* ⚛️ React usage examples
55+
* 🚨 Error handling tips
56+
* 📦 Real world use cases
57+
* 🔐 Browser support tables
2658

27-
* 🧱 Simple, modular functions
28-
* 💻 Full TypeScript support
29-
* ⚛️ Framework-agnostic usage
30-
* 🌍 Real-world features: dark mode toggle, idle timer, network detection, tab visibility, and more
59+
Each page is written for **developers**, not bots. With TypeScript context and practical examples that work in real apps.
3160

3261
---
3362

3463
## 📦 Installation
3564

36-
### Via NPM/Yarn:
37-
3865
```bash
3966
npm install webdev-power-kit
4067
# or
4168
yarn add webdev-power-kit
4269
```
43-
4470
### Via CDN (ES Module):
4571

4672
```html
@@ -49,9 +75,6 @@ yarn add webdev-power-kit
4975
copyToClipboard('Hello via CDN!');
5076
</script>
5177
```
52-
53-
---
54-
5578
## ⚡ Quickstart
5679

5780
### HTML (CDN ESM):
@@ -72,76 +95,77 @@ export default function App() {
7295
}
7396
```
7497

75-
---
98+
## 🚀 Usage Example
7699

77-
## 📚 Documentation
100+
```ts
101+
import { copyToClipboard } from "webdev-power-kit/browser/clipboard";
78102

79-
Explore detailed guides, feature docs, and examples in the docs section:
103+
copyToClipboard("Hello from clipboard!")
104+
.then(() => console.log("Copied!"))
105+
.catch(err => console.error("Error copying:", err));
106+
```
80107

81-
👉 [Full documentation](https://webdev-power-kit.hashnode.space/docs/introduction)
82108

83-
---
84109

85-
## ✅ Features
110+
```tsx
111+
"use client";
86112

87-
| Browser Feature | Functionality |
88-
| ----------------- | ---------------------------------- |
89-
| 🔋 Battery | Check level & charging status |
90-
| 📋 Clipboard | Copy & read text |
91-
| 🌙 Dark Mode | Detect, toggle, listen to changes |
92-
| ⏳ Idle Timer | Detect user inactivity |
93-
| 🌐 Network | Track online/offline status |
94-
| 📢 Notifications | Show native browser notifications |
95-
| 🛑 Prevent Close | Warn before leaving the page |
96-
| 🕶 Tab Visibility | Detect switching or hiding the tab |
97-
| 📳 Vibration | Control device vibration |
98-
| 📍 Geolocation | Use GPS to get user’s location |
99-
| 📐 Screen Info | Get viewport & screen dimensions |
113+
import React from "react";
114+
import { useEffect } from "react";
115+
import { isOnline } from "webdev-power-kit/browser/network/is-online";
100116

101-
More features coming soon!
117+
export default function NetworkStatus() {
118+
useEffect(() => {
119+
console.log("User is online:", isOnline());
120+
}, []);
121+
return <p>Check console for online status ✅</p>;
122+
}
123+
```
102124

103125
---
104126

105-
## 🧩 How It Works
127+
## 🤝 Contributing
106128

107-
* Built in **TypeScript** for clean code and types
108-
* Modular structure—import only what you need
109-
* Plain functions using native browser APIs
110-
* Graceful error and support handling
111-
* No dependencies—install size is minimal
129+
Pull requests are welcome! For major changes, please open an issue first.
112130

113-
---
131+
We follow a clean modular structure — every feature must:
114132

133+
* Be placed in its own folder (Meaningful name)
134+
* Include `index.ts` with typed exports
135+
* Handle errors gracefully
136+
* Include comments and JSDoc
137+
* Follow `files` whitelist in `package.json`
138+
139+
---
115140
## 📝 FAQ
116141

117142
* **Does it work with frameworks?**
118-
Yes, fully compatible with React, Vue, Svelte, or Vanilla JS.
143+
>. Yes, fully compatible with React, Vue, Svelte, or Vanilla JS.
119144
120145
* **Need HTTPS or special setup?**
121-
Some features (clipboard, geolocation) require secure context. Testing with `file://` won’t work—use Live Server or serve locally.
146+
> Some features (clipboard, geolocation) require secure context. Testing with `file://` won’t work—use Live Server or serve locally.
122147
123148
* **What browsers are supported?**
124-
Modern desktop and mobile browsers are fully supported. Specific browser notes are included in each feature doc.
125-
149+
> Modern desktop and mobile browsers are fully supported. Specific browser notes are included in each feature doc.
126150
---
127151

128-
## 🛠 Contributing
152+
## 👨‍💻 Author
129153

130-
Add features, file issues, or fix bugs—open a PR!
131-
Project is MIT licensed and open for community involvement.
154+
**Aditya Kumar Gupta**
155+
Computer Science Engineer • Web Developer • Hackathon Enthusiast
132156

133-
---
157+
* 🔗 [Portfolio](https://your-portfolio-link)
158+
* 🐙 [GitHub](https://github.com/adityakgupta)
159+
* 📝 [Hashnode Docs](https://webdev-power-kit.hashnode.dev/docs/introduction)
134160

135-
## ⚡ License
161+
---
136162

163+
## 📄 License
137164
Distributed under the **MIT License**.
138165
See `LICENSE` for details.
139166

140-
---
141-
142-
## 🔗 Stay Connected
143167

144-
* 📘 GitHub: [dev-aditya-lab/webdev-power-kit](https://github.com/dev-aditya-lab/webdev-power-kit)
145-
* 🧑‍💻 Author: Aditya Kumar Gupta
146-
* 💬 Issues & feedback: via GitHub issues or pull requests
168+
---
147169

170+
> 🚀 `webdev-power-kit` makes building professional browser-based apps faster, safer, and fun again.
171+
> Import only what you need — clean, typed, and production-ready.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webdev-power-kit",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A powerful toolkit that simplifies access to browser features like clipboard, notifications, battery, vibration, and more — perfect for modern web developers.",
55
"keywords": ["webdev","browser-api","clipboard","battery","notification","vibration","developer-tools","frontend", "html5-api","javascript","typescript","web-utilities","productivity"],
66
"homepage": "https://github.com/dev-aditya-lab/webdev-power-kit#readme",

webdev logo long.png

419 KB
Loading

0 commit comments

Comments
 (0)