@techandsoftware/teletext
Advanced tools
Comparing version 0.5.2 to 0.5.3
{ | ||
"name": "@techandsoftware/teletext", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "API to render teletext pages using vector graphics in the browser DOM", | ||
@@ -46,4 +46,6 @@ "browser": "dist/teletext.umd.min.js", | ||
"LICENSES", | ||
"dist" | ||
"dist", | ||
"package.json.license", | ||
"demo" | ||
] | ||
} |
@@ -62,13 +62,14 @@ <!-- | ||
1. Install dependency: | ||
```npm install @techandsoftware/teletext``` | ||
## As an ES6 module | ||
2. In your HTML, include the following to use an an ES6 module: | ||
```html | ||
<script type="module"> | ||
// Import as an ES6 module | ||
import { teletext } from './node_modules/@techandsoftware/teletext/dist/teletext.min.js'; | ||
// Or import the npm module (you will also need tooling to resolve the module for the browser) | ||
import { teletext } from '@techandsoftware/teletext'; | ||
// Or if you import the npm module directly, use the following import instead of the one above. (You will also need tooling to resolve the module for the browser, like @rollup/plugin-node-resolve) | ||
// import { teletext } from '@techandsoftware/teletext'; | ||
@@ -84,6 +85,4 @@ teletext.addTo('#teletextscreen'); | ||
## Using `script src` | ||
Alternatively, for browsers that don't support ES6 module imports, you can use the UMD module. The exports are exported to the `ttx` global, so you need to prefix API calls with that. The syntax in the Javascript is likely to be too new so you will also need to arrange transpiling to your target browser. | ||
For browsers that don't support ES6 module imports, you can use the UMD module. The exports are exported to the `ttx` global, so you need to prefix API calls with that. | ||
```html | ||
@@ -97,4 +96,8 @@ <script src="./node_modules/@techandsoftware/teletext/dist/teletext.umd.min.js"></script> | ||
See the `demo` for examples of these. | ||
# Demos | ||
See the `demo` directory for examples of using with an ES6 module import or a UMD import. | ||
For a live demo, see https://teletextmoduledemo.robdev.org.uk/ | ||
# API | ||
@@ -101,0 +104,0 @@ |
1269541
27
356
14