Open Chinese Convert
1.0.3
A project for conversion between Traditional and Simplified Chinese
Main Page
Modules
Classes
Examples
All
Classes
Functions
Typedefs
Modules
node/demo.js
This is an example of how to use the Node.js API.
// In your project you should replace './opencc' with 'opencc'
var OpenCC = require(
'./opencc'
);
// Load the default Simplified to Traditional config
var
opencc
=
new
OpenCC(
's2t.json'
);
// Sync API
var converted =
opencc
.convertSync(
"汉字"
);
console.log(converted);
// Async API
opencc
.convert(
"汉字"
,
function
(err, converted) {
console.log(converted);
});
Generated on Tue Jul 19 2016 15:29:35 for Open Chinese Convert by
1.8.8