![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
s4-client-lib
Advanced tools
Client library for S4 clients. Provides the necessary API to convert a stream of incoming data into an HTTP request with necessary metadata in headers.
A client library developed on node.js that can be used to send data files to the S4 service for processing.
The goal of this library is to abstract from an end user application the mechanics of creating and dispatching HTTP requests, and handling coressponding responses. In addition to using this library in scenarios where the input data is a real time audio stream, it can also be used in test scenarios, where the data is read from a static file and sent to the server for testing/evaluation.
This documentation outlines how the library can be downloaded and used as a dependency to an application.
This library has been developed using JavaScript for the NodeJs engine, specifically version 10+ of NodeJS.
This library can be installed by using the npm tool as follows:
npm install git+https://gitlab.lyricsemiconductor.com/platformdevops/s4-client-lib.git
** NOTE: **
- Use the
--save
option to save the dependency in your project'spackage.json
file
Include the library in your code by using require
:
var s4ClientLib = require('s4-client-lib');
Before data can be sent to a server, a new client object must be created as follows:
var client = new s4ClientLib.S4Client('http://asr.lyricsemiconductor.com/service_path', {
apiKey: 'QRTV4Fh2W+ID',
micConfig: '<mic config data>'
});
The first argument to the constructor is the url of the S4 service endpoint. The second argument is configuration information for the client request. Details are as follows:
apiKey
: A shared secret key that the client can use to authenticate against the servermicConfig
: A string that specifies the microphone configurationOnce a client object has been created, a data can be streamed to the service by invoking the sendStream(readable)
method, with a readable stream as the first argument.
var stream = createStreamFromSource();
var promise = client.sendStream(stream);
All requests made using the client object will return a promise that conforms to the (Promises/A+)[https://promisesaplus.com/] specification. Each promise supports a then
method that can be invoked with a success handler and a failure handler, as shown below:
promise.then(function(response) {
//Handle success here. The response parameter is the return object from the server.
}, function(err) {
// Handle failure here. The err object contains details of the error that caused the failure.
});
FAQs
Client library for S4 clients. Provides the necessary API to convert a stream of incoming data into an HTTP request with necessary metadata in headers.
The npm package s4-client-lib receives a total of 2 weekly downloads. As such, s4-client-lib popularity was classified as not popular.
We found that s4-client-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.