txttosl-api
v2.0.1
Published
Translate text into sign languages with TxtToSL's API.
Downloads
14
Maintainers
Readme
txttosl-api-node
A simple Node module to allow using TxtToSL's API to translate text into sign languages.
const txttosl = require('txttosl-api');
txttosl.translate('Hello world!', 'BSL').then((url) => {
console.log(url);
// example output: https://v.txttosl.com/yirCaRNq.gif
});
More options are avaliable with the third argument:
const txttosl = require('txttosl-api');
txttosl.translate('Hello world!', 'BSL', {hoster: 'imgur'}).then((url) => {
console.log(url);
// example output: https://i.imgur.com/1kzUhOJ.gif
});
const txttosl = require('txttosl-api');
txttosl.translate('Hello world!', 'BSL', {overlay: false}).then((url) => {
console.log(url);
// example output: https://v.txttosl.com/BkakvkDo.gif
});
Progress callback / feedback is avaliable in the fourth and fifth arguments:
const txttosl = require('txttosl-api');
const progressCallback = (msg) => { console.log(`callback: ${msg}`); };
txttosl.translate('Hello world!', 'BSL', {}, progressCallback, 'my-project-identifier')
.then((url) => {
console.log(`url: ${url}`);
});
/* example output:
callback: Importing library 'yaspin'...
...etc...
callback: Uploading...
callback: Uploaded to: https://v.txttosl.com/fvzPhJim.gif
url: https://v.txttosl.com/fvzPhJim.gif
*/