Installation

(Note: make sure npm is installed.)

  • Go to the project directory
cd /path/to/project/
  • Install @xylem-js/xylem-js package:
npm install @xylem-js/xylem-js --save-exact
  • (Optional) To use JSX syntax, install @xylem-js/jsx package:
npm install @xylem-js/jsx --save-exact

To check installation:

  • Create index.html with 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.html file in web browser. Open dev-tools (F12), choose "Console" tab and check for the messages from console.log in the "Console" tab in dev-tools. You should be able to see the following text in console:
Hello Foo