https://github.com/devnote-dev/inspect
Inspect tool from JS implemented in Dart
https://github.com/devnote-dev/inspect
Last synced: 10 months ago
JSON representation
Inspect tool from JS implemented in Dart
- Host: GitHub
- URL: https://github.com/devnote-dev/inspect
- Owner: devnote-dev
- License: gpl-3.0
- Created: 2021-10-11T16:25:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-01T15:23:25.000Z (about 4 years ago)
- Last Synced: 2025-02-05T21:37:10.879Z (12 months ago)
- Language: Dart
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Inspect
If you are familiar with JavaScript's `inspect` module then this is essentially an implementation of that in Dart. If you don't, then this package basically parses and formats an object into a readable string (usually used for console related activities). This can be a Dart literal object, a class (custom or built-in), function or type(s). Like the JS module it also has optional colouring (although it should not be used in debug consoles as the colouring does not always output correctly).
## Why use this?
You don't have to use this, there are a few bugs with this that are yet to be fixed. This package is for testing purposes and part of me learning Dart (but can be used for other things). There is most likely a better version of this somewhere in the pub which you should use instead.
## Examples
You can see a full list of examples by running `dart run` after installing the package, but here's a quick one:
```dart
import 'package:inspect.dart';
class Vector {
num x, y;
Vector(this.x, this.y);
num mult() => x * y;
}
void main() {
print(inspect(Vector(3, 2)));
}
```
Output:
```shell
Vector {
x: 3;
y: 2;
mult: ;
Vector: ;
}
```
This repository is managed under the AGPL v3 license.
© 2021-2022 devnote-dev