Installation
(Note: make sure npm is installed.)
- Go to the project directory
cd /path/to/project/
- Install
@xylem-js/xylem-jspackage:
npm install @xylem-js/xylem-js --save-exact
- (Optional) To use JSX syntax, install
@xylem-js/jsxpackage:
npm install @xylem-js/jsx --save-exact
To check installation:
- Create
index.htmlwith following content:
<!doctype html>
<html>
<body>
<script type="module">
import createStore from './node_modules/@xylem-js/xylem-js/core/createStore.js';
const name$ = createStore('Foo');
console.log('Hello ' + name$._());
</script>
</body>
</html>
- Start a web server and open the
index.htmlfile in web browser. Open dev-tools (F12), choose "Console" tab and check for the messages fromconsole.login the "Console" tab in dev-tools. You should be able to see the following text in console:
Hello Foo