api-framework
API for ShZWare-Framework
Installation
npm install @shzware-framework/main
Usage
const api = require('@shzware-framework/api');
Example
const api = require('@shzware-framework/api');
console.log(api.frameworkVersion);
console.log(api.frameworkAPIVersion);
api.log('Hello world!');
const table = api.createAscii('your table name', 'heading name 1', 'heading name 2');
console.log(table.toString());
api.log(table.toString(), 'none');
const apiKey = 'your-api-key', voiceId = 'any-voiceId-from-elevenlabs';
const getResponse = api.getElevenLabsVoice(apiKey, voiceId).then(res => {
console.log(res);
})
const apiKey = 'your-api-key';
const getResponse = api.getElevenLabsVoice(apiKey).then(res => {
console.log(res);
})
const apiKey = 'your-api-key', voiceId = 'any-voiceId-from-elevenlabs';
const getResponse = api.getElevenLabsVoiceSettings(apiKey, voiceId).then(res => {
console.log(res);
})
const apiKey = 'your-api-key', voiceId = 'any-voiceId-from-elevenlabs';
const text = 'Hello';
const modelId = 'any-modelId-from-my-api';
const fileName = 'textToSpeech.mp3';
const getResponse = api.getElevenLabsTextToSpeech(apiKey, voiceId, fileName, text, modelId).then(res => {
res.pipe(api.fs.createWriteStream(fileName));
})
License
The project is released under the MIT license.