Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexbinary/nw-playground
Quick experiments with NW.js
https://github.com/alexbinary/nw-playground
Last synced: 1 day ago
JSON representation
Quick experiments with NW.js
- Host: GitHub
- URL: https://github.com/alexbinary/nw-playground
- Owner: alexbinary
- License: mit
- Created: 2015-12-02T17:29:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-26T10:28:04.000Z (almost 9 years ago)
- Last Synced: 2023-10-28T04:50:18.104Z (about 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nw-playground
> Quick experiments with NW.js
## Install
```
npm install nw-playground
```## Usage
```javascript
require('nw-playground')(document).convertAll();
```This will turn all code that looks like this :
```html
console.log('hello');
```Into this :
```html
console.log('hello');
Run
```User will be able to edit the content of the `
` tag.
Clicking the `Run` button will create a `` tag containing the code currently inside the `<pre>` tag nested inside a closure, and append it at the end of the `<body>` :```html
<body>
<!-- ... -->
<script>
(function() {
console.log('hello');
})();
hljs.configure(/* ... */);
require('nw-playground')(document, hljs).convertAll();