
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@tressohi/smlayer
Advanced tools
SMLAYER JS is a library built with Parcel JS that allows developers to easily make use of [Smart Layers](https://app.smartlayers.io)-generated pipelines and models within their applications.
SMLAYER JS is a library built with Parcel JS that allows developers to easily make use of Smart Layers-generated pipelines and models within their applications.
To create build files in the dist folder, run the command below.
npx parcel build
For now SMLAYER can be installed by simply pointing npm install
to the directory of the SMLAYER folder on your local machine just like the code below. In the future, npm install smlayer
should do it.
npm install "path_to_smlayer"
For now, the following methods are available in smlayer:
submit(formData)
: This method allows you to upload a file to a pipeline for processing. To use it, you should have form-data installed within your project.sumbitSync(formData)
: This allows upload, and is obligated to wait until your result is completely processed, before returning a response. It also relies on form-data
for parsing files.submitFromPath(filePath)
: Another method of upload, that simply requires you to just pass in the path to the file in question.getAllResults()
: Get all the results in a particular pipeline.getSingleResult(resultId)
: Get a single result from the pipeline based on its ID.
import Pipeline from "smlayer";
import FormData from "form-data";
import * as fs from "fs";
let pipeline = new Pipeline(pipelineId, apiKey);
let formData = new FormData();
let file = fs.createReadStream(_fileLocation_);
formData.append( "file", file);
let res = await pipe.submit(formData);
console.log(res.data);
NOTE : Files to be uploaded via FormData are to be parsed with the name, "file".
import Pipeline from "smlayer";
import FormData from "form-data";
import * as fs from "fs";
let pipeline = new Pipeline(pipelineId, apiKey);
let formData = new FormData();
let file = fs.createReadStream(_fileLocation_);
formData.append("file", file);
let res = await pipe.submitSync(formData);
console.log(res);
import Pipeline from "smlayer";
let pipeline = new Pipeline(pipelineId, apiKey);
let res = await pipe.submitFromPath(_filePath_);
console.log(res);
import Pipeline from "smlayer";
let pipeline = new Pipeline(pipelineId, apiKey);
let res = await pipe.getAllResults();
console.log(res);
import Pipeline from "smlayer";
let pipeline = new Pipeline(pipelineId, apiKey);
let res = await pipe.getSingleResult(resultId);
console.log(res);
FAQs
SMLAYER JS is a library built with Parcel JS that allows developers to easily make use of [Smart Layers](https://app.smartlayers.io)-generated pipelines and models within their applications.
The npm package @tressohi/smlayer receives a total of 0 weekly downloads. As such, @tressohi/smlayer popularity was classified as not popular.
We found that @tressohi/smlayer 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.