Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 9f49369

Browse files
author
Sai Prakash
committed
Updated the Readme instructions and bumped the version number
1 parent f9562fe commit 9f49369

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,40 @@ Dlog is inspired by the useful `node-debug` utility for Node.js logging from TJ.
1717

1818
## Installation
1919

20-
To include Dlog in your project, simply copy the `Dlog.js` file into your project directory. You can then import or require `Dlog` in your JavaScript files.
20+
Install Dlog via npm:
21+
22+
```bash
23+
npm install dlog-web
24+
```
25+
26+
### For CommonJS usage
27+
28+
After installation, you can require Dlog in your project:
2129

2230
```javascript
23-
import Dlog from './path/to/Dlog.js';
31+
const Dlog = require('dlog-web/dist/dlog.cjs');
2432
```
2533

26-
Or, if you're using CommonJS modules:
34+
### For ES Modules
35+
36+
If your project uses ES Modules, you can import Dlog directly after installation. This method works well for modern JavaScript projects that utilize import/export syntax.
2737

2838
```javascript
29-
const Dlog = require('./path/to/Dlog.js');
39+
import Dlog from 'dlog-web/dist/dlog.esm.js';
3040
```
3141

42+
### For Browser Environments
43+
44+
For direct usage in the browser, you can reference the minified version of Dlog. This method is ideal for projects that aren't using a module bundler or build process.
45+
46+
Locate the file `node_modules/dlog-web/dist/dlog.min.js`. Then, include it in your HTML file using a `<script>` tag:
47+
48+
```html
49+
<script src="path/to/dlog.min.js"></script>
50+
```
51+
52+
After including the script, `Dlog` will be available as a global variable:
53+
3254
## Usage
3355

3456
### Basic Usage

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dlog-web",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"description": "A customizable JavaScript logger for the browser which offers namespace-based log management, global silence control, error logging, and customizable styling for development and production logging.",
55
"main": "dist/dlog.cjs.js",
66
"module": "dist/dlog.esm.js",

0 commit comments

Comments
 (0)