by NativeScript Community | v1.0.0-alpha.3
A compiler that turns NativeScript XML UI content into JavaScript.
npm i --save @nativescript-community/xml-ui-compiler
  • Version: 1.0.0-alpha.3
  • GitHub:
  • Downloads:
    • Last Day:   0
    • Last Week:  0
    • Last Month: 11


npm npm

A Node compiler that converts NativeScript XML view content to AST.


npm install @nativescript-community/xml-ui-compiler --save-dev


import fs from 'fs';
import generate from '@babel/generator';
import { compile } from '@nativescript-community/xml-ui-compiler';

const filePath = 'views/home/home.xml';
const content = fs.readFileSync(filePath, 'utf8');

const { output } = compile(content, filePath, 'android');

// Convert AST to JS and print