Open Chinese Convert
1.0.1
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 Sat Oct 18 2014 17:42:43 for Open Chinese Convert by
1.8.8