Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 2.59 KB

README.en.md

File metadata and controls

63 lines (45 loc) · 2.59 KB

san-ssr-target-php

npm version downloads Build Status Coveralls dependencies semantic-release GitHub issues David David Dev DUB license Commitizen friendly

Install

Supported Environment

  • PHP 5 >= 5.3.0, PHP 7
npm i san san-ssr san-ssr-target-php

CLI Usage

Command line interface:

san-ssr --target php --compile '{"nsPrefix":"demo\\"}' ./component.ts > ssr.php

Programmatic Interface

Pass 'php' as the second parameter of SanProject [SanProject#compile(filepath, target, options)][.compile()] method.

TypeScript:

import { Target, SanProject } from 'san-ssr'
import { writeFileSync } from 'fs'

const project = new SanProject()
const targetCode = project.compile('src/component.ts', 'php')

writeFileSync('ssr.php', targetCode)

Or in JavaScript:

import { Target, SanProject } from 'san-ssr'
import { writeFileSync } from 'fs'

const project = new SanProject()
const targetCode = project.compile('src/component.ts', 'php')

writeFileSync('ssr.php', targetCode)