first commit
This commit is contained in:
23
node_modules/obug/LICENSE
generated
vendored
Normal file
23
node_modules/obug/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright © 2025-PRESENT Kevin Deng (https://github.com/sxzz)
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
||||
Copyright (c) 2018-2021 Josh Junon
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
106
node_modules/obug/README.md
generated
vendored
Normal file
106
node_modules/obug/README.md
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
# obug
|
||||
|
||||
[![npm version][npm-version-src]][npm-version-href]
|
||||
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
||||
[![Unit Test][unit-test-src]][unit-test-href]
|
||||
|
||||
A lightweight JavaScript debugging utility, forked from [debug](https://www.npmjs.com/package/debug), featuring TypeScript and ESM support.
|
||||
|
||||
> [!NOTE]
|
||||
> obug v1 retains most of the compatibility with [debug](https://github.com/debug-js/debug), but drops support for older browsers and Node.js, making it a drop-in replacement.
|
||||
>
|
||||
> obug v2 refactors some API imports and usage for better support of ESM and TypeScript, easier customization, and an even smaller package size.
|
||||
|
||||
## Key Differences from `debug`
|
||||
|
||||
- ✨ Minimal footprint
|
||||
- 7.7 kB package size
|
||||
- 1.4 KB minified + gzipped for browsers
|
||||
- 📦 Zero dependencies
|
||||
- 📝 Full TypeScript support
|
||||
- 🚀 Native ESM compatibility
|
||||
- 🌐 Optimized for modern runtimes
|
||||
- ES2015+ browsers
|
||||
- Modern Node.js versions
|
||||
- 🎨 Customizable formatting
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install obug
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { createDebug, disable, enable, enabled, namespaces } from 'obug'
|
||||
|
||||
// Get the currently enabled namespaces
|
||||
console.log(namespaces())
|
||||
|
||||
const debug = createDebug('my-namespace', {
|
||||
// All options are optional
|
||||
|
||||
useColors: true, // false, true, undefined for auto-detect
|
||||
color: 2, // custom color
|
||||
// custom formatArgs
|
||||
formatArgs(args) {},
|
||||
formatters: {},
|
||||
// Node.js only
|
||||
inspectOpts: {},
|
||||
|
||||
// custom log
|
||||
log: console.log,
|
||||
})
|
||||
|
||||
debug('This is a debug message')
|
||||
console.log(
|
||||
debug.namespace, // 'my-namespace'
|
||||
debug.enabled, // Check if enabled
|
||||
debug.useColors, // true
|
||||
debug.color, // 2
|
||||
debug.formatArgs, // custom formatArgs
|
||||
debug.formatters, // {}
|
||||
debug.inspectOpts, // {}
|
||||
debug.log, // implemented log function
|
||||
)
|
||||
|
||||
// Create a sub-namespace, and it will inherit options from the parent debugger
|
||||
const sub = debug.extend('sub-namespace')
|
||||
sub('This is a sub-namespace debug message')
|
||||
console.log(sub.namespace) // 'my-namespace:sub-namespace'
|
||||
```
|
||||
|
||||
## Original Authors
|
||||
|
||||
As obug is a fork of debug with significant modifications, we would like to acknowledge the original authors:
|
||||
|
||||
- TJ Holowaychuk
|
||||
- Nathan Rajlich
|
||||
- Andrew Rhyne
|
||||
- Josh Junon
|
||||
|
||||
## Sponsors
|
||||
|
||||
<p align="center">
|
||||
<a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
|
||||
<img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) License © 2025-PRESENT [Kevin Deng](https://github.com/sxzz)
|
||||
|
||||
[The MIT License](./LICENSE) Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
[The MIT License](./LICENSE) Copyright (c) 2018-2021 Josh Junon
|
||||
|
||||
<!-- Badges -->
|
||||
|
||||
[npm-version-src]: https://img.shields.io/npm/v/obug.svg
|
||||
[npm-version-href]: https://npmjs.com/package/obug
|
||||
[npm-downloads-src]: https://img.shields.io/npm/dm/obug
|
||||
[npm-downloads-href]: https://www.npmcharts.com/compare/obug?interval=30
|
||||
[unit-test-src]: https://github.com/sxzz/obug/actions/workflows/unit-test.yml/badge.svg
|
||||
[unit-test-href]: https://github.com/sxzz/obug/actions/workflows/unit-test.yml
|
||||
68
node_modules/obug/package.json
generated
vendored
Normal file
68
node_modules/obug/package.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "obug",
|
||||
"version": "2.1.1",
|
||||
"description": "A lightweight JavaScript debugging utility, forked from debug, featuring TypeScript and ESM support.",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/sxzz/obug#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/sxzz/obug/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sxzz/obug.git"
|
||||
},
|
||||
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/sxzz",
|
||||
"https://opencollective.com/debug"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/node.js",
|
||||
"module": "./dist/node.js",
|
||||
"types": "./dist/browser.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"browser": "./dist/browser.js",
|
||||
"default": "./dist/node.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"unpkg": "./dist/browser.min.js",
|
||||
"jsdelivr": "./dist/browser.min.js",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sxzz/eslint-config": "^7.3.0",
|
||||
"@sxzz/prettier-config": "^2.2.5",
|
||||
"@types/debug": "^4.1.12",
|
||||
"@types/node": "^24.10.1",
|
||||
"@vitest/browser-playwright": "^4.0.10",
|
||||
"@vitest/coverage-v8": "^4.0.10",
|
||||
"bumpp": "^10.3.1",
|
||||
"debug": "^4.4.3",
|
||||
"eslint": "^9.39.1",
|
||||
"playwright": "^1.56.1",
|
||||
"prettier": "^3.6.2",
|
||||
"tsdown": "^0.16.5",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.2.2",
|
||||
"vitest": "^4.0.10"
|
||||
},
|
||||
"prettier": "@sxzz/prettier-config",
|
||||
"scripts": {
|
||||
"lint": "eslint --cache .",
|
||||
"lint:fix": "pnpm run lint --fix",
|
||||
"build": "tsdown",
|
||||
"dev": "tsdown --watch",
|
||||
"test": "vitest",
|
||||
"test:coverage": "vitest --project node --coverage",
|
||||
"play": "vite playground",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"format": "prettier --cache --write .",
|
||||
"release": "bumpp"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user