https://github.com/disjukr/vector-devtools
vector formatter for chrome devtools
https://github.com/disjukr/vector-devtools
Last synced: 2 months ago
JSON representation
vector formatter for chrome devtools
- Host: GitHub
- URL: https://github.com/disjukr/vector-devtools
- Owner: disjukr
- License: other
- Created: 2016-04-13T15:09:19.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-13T15:11:43.000Z (about 9 years ago)
- Last Synced: 2025-03-18T12:02:25.437Z (2 months ago)
- Language: JavaScript
- Size: 139 KB
- Stars: 43
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vector-devtools
vector formatter for chrome devtools.
inspired by [immutable-devtools](https://github.com/andrewdavey/immutable-devtools)## install
```sh
$ npm install vector-devtools
```## example
```js
class Vec2D {
constructor(x, y) {
this.x = x;
this.y = y;
}
}window.devtoolsFormatters = [ new vectorDevTools.VectorFormatter(Vec2D) ];
setInterval(() => {
const t = Date.now() / 1000;
const len = Math.sin(t * 2);
console.log(new Vec2D(Math.cos(t) * len, Math.sin(t) * len));
}, 100);
```
## how to use
1. open chrome devtools settings
2. check "Enable custom formatters"
3. write and run above example
## license
[zlib](./LICENSE)