@vtabary/xliff2js
Tools to manipulate XLIFF contents.
Last updated 8 months ago by vtabary .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @vtabary/xliff2js 
SYNC missed versions from official npm registry.

@vtabary/xliff2js

Tools to manipulate XLIFF contents.

Build Status

Installation

# Use npm
npm install @vtabary/xliff2js

# Or use yarn
yarn add @vtabary/xliff2js

Class: XliffParser

Converts a XLIFF string into a JSON object.

Usage

var XliffParser = require('xliff2js').XliffParser;
var obj = new XliffParser().parse('</root><root>');
console.log(JSON.stringify(obj, undefined, 2));

// displays :
// { name: 'root', '$': {}, children: [] }

constructor()

Options

No option available.

#parse(xml: string): IXliff

Options

  • xml an XLIFF valid as a string

Class: XliffBuilder

Converts a JSON object to XLIFF string.

Usage

var XliffBuilder = require('xliff2js').XliffBuilder;
var str = new XliffBuilder({ pretty: true }).build({
  name: 'xliff',
  $: {},
  children: []
});
console.log(str);

// displays :
// '<?xml version="1.0"?><xliff/>'

constructor(options)

Options

  • pretty indents tags in result. Default: false.

#build(object: IXliff): string

Options

  • object a JSON object matching

Current Tags

  • 0.2.1                                ...           latest (8 months ago)

3 Versions

  • 0.2.1                                ...           8 months ago
  • 0.2.0                                ...           8 months ago
  • 0.1.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |