gitbook-plugin-js-console
v3.2.0
Published
GitBook plugin that provide interactive JavaScript console
Downloads
331
Readme
gitbook-plugin-js-console
GitBook plugin that provide interactive JavaScript console.
Dependencies:
Install
Install with npm:
npm install gitbook-plugin-js-console
Usage
put "js-console" to your book.json
{
"gitbook": ">=3.0.0",
"plugins": [
"js-console"
]
}
Add <!-- js-console -->
or class="gitbook-plugin-js-console"
node before/after of CodeBlock.
<!-- js-console -->
```js
1 + 2;
```
Add <!-- js-console:{ "state": "open" } -->
and this console is opened by default.
<!-- js-console:{ "state": "open" } -->
```js
1 + 2;
```
Add <!-- js-console:{ "type": "module" } -->
and this console will execute the code as ECMAScript Module.
:memo: Current limitation: ES Modules mode does not return value
<!-- js-console:{ "type": "module" } -->
```js
await 1; // Module allow Top-Level await
```
For more details, See website.
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test
:
npm i -d && npm test
Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu