Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@asposecloud/aspose-html-cloud
Advanced tools
Aspose.Html Cloud is a true REST API that enables you to perform a wide range of html processing operations including manipulation and conversion in the cloud, with zero initial costs. Our Cloud SDKs are wrappers around REST API in various programming languages, allowing you to process html pages in language of your choice quickly and easily, gaining all benefits of strong types and IDE highlights.
This repository contains Aspose.HTML Cloud SDK for Node.js source code. This SDK allows you to work with Aspose.HTML Cloud REST APIs in your Node.js applications quickly and easily.
See API Reference for full API specification.
The complete source code is available in this repository folder, you can either directly use it in your project via npm package manager.
To use Aspose HTML for Cloud Node.js SDK you need to register an account with Aspose Cloud and lookup/create App Key and SID at Cloud Dashboard. There is a free quota available. For more details, see Aspose Cloud Pricing.
npm install @asposecloud/aspose-html-cloud --save
Install it via:
npm install https://github.com/aspose-html-cloud/aspose-html-cloud-nodejs --save
Please, add the following nmp package to your project.json as a dependency.
{
"dependencies": {
"@asposecloud/aspose-html-cloud":"^22.12.1"
}
}
Please follow the installation instruction and execute the following JS code:
NOTE: Use the helper from /test/helper.js for an upload and save data.
// Get keys from aspose site.
// There is free quota available.
// For more details, see https://purchase.aspose.cloud/pricing
var conf = {
"basePath":"https://api.aspose.cloud/v4.0",
"authPath":"https://api.aspose.cloud/connect/token",
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"defaultUserAgent":"NodeJsWebkit"
};
var api = require('@asposecloud/aspose-html-cloud');
// Create Conversion Api object
var conversionApi = new api.ConversionApi(conf);
var src = "/path/to/src/test.html"; // {String} Source document.
var dst = "/path/to/dst/test.jpeg"; // {String} Result document.
//Setup various option for result image
var opts = {
'width': 800, // {Number} Resulting image width in pixels.
'height': 1000, // {Number} Resulting image height in pixels.
'leftMargin': 10, // {Number} Left resulting image margin in pixels.
'rightMargin': 10, // {Number} Right resulting image margin in pixels.
'topMargin': 20, // {Number} Top resulting image margin in pixels.
'bottomMargin': 20 // {Number} Bottom resulting image margin in pixels.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log(data);
}
};
conversionApi.convertLocalToLocal(src, dst, opts, callback);
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your package from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('@asposecloud/aspose-html-cloud')
in javascript files from the directory you ran the last
command above from.
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Before fill all fields in configuration object (see tests)
Example:
var conf = {
"basePath":"https://api.aspose.cloud/v4.0",
"authPath":"https://api.aspose.cloud/connect/token",
"apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"defaultUserAgent":"Webkit"
}
All URIs are relative to https://api.aspose.cloud/v4.0
Tests contain various examples of using the Aspose.HTML SDK.
Class | Method | Description |
---|---|---|
Asposehtmlcloud.ConversionApi | convertLocalToLocal | Convert a document from local disk to a local disk. |
Asposehtmlcloud.ConversionApi | convertLocalToStorage | Convert a document from local disk to user's storage. |
Asposehtmlcloud.ConversionApi | convertStorageToLocal | Convert a document from user's storage to local disk. |
Asposehtmlcloud.ConversionApi | convertStorageToStorage | Convert a document from user's storage to user's storage. |
Asposehtmlcloud.ConversionApi | convertUrlToLocal | Convert the HTML document by URL to local disk. |
Asposehtmlcloud.ConversionApi | convertUrlToStorage | Convert the HTML document by URL to user's storage. |
Asposehtmlcloud.ConversionApi | convert | Convert a document to the specified format. |
Class | Method | Description |
---|---|---|
Asposehtmlcloud.VectorizationApi | vectorizeLocalToLocal | Vectorization an image from local disk to a local disk. |
Asposehtmlcloud.VectorizationApi | vectorizeLocalToStorage | Vectorization an image from local disk to user's storage. |
Asposehtmlcloud.VectorizationApi | vectorizeStorageToLocal | Vectorization an image from user's storage to local disk. |
Asposehtmlcloud.VectorizationApi | vectorizeStorageToStorage | Vectorization an image from user's storage to user's storage. |
Asposehtmlcloud.VectorizationApi | vectorize | Vectorization an image to the specified format. |
Class | Method | HTTP request | Description |
---|---|---|---|
Asposehtmlcloud.StorageApi | deleteFile | DELETE /html/file | Delete file |
Asposehtmlcloud.StorageApi | downloadFile | GET /html/file | Download file |
Asposehtmlcloud.StorageApi | uploadFile | POST /html/file | Upload file |
Asposehtmlcloud.StorageApi | createFolder | POST /html/folder | Create the folder |
Asposehtmlcloud.StorageApi | deleteFolder | DELETE /html/folder | Delete folder |
Asposehtmlcloud.StorageApi | getFilesList | GET /html/folder | Get all files and folders within a folder |
Asposehtmlcloud.StorageApi | getDiscUsage | GET /html/storage/disc | Get disc usage |
Asposehtmlcloud.StorageApi | objectExists | GET /html/storage/exist | Check if file or folder exists |
Asposehtmlcloud.StorageApi | storageExists | GET /html/storage/exist/storage | Check if storage exists |
node.exe ./node_modules/mocha/bin/_mocha --ui bdd ./test
Please follow the installation instruction for write config file.
FAQs
Aspose.Html Cloud Node.js SDK
The npm package @asposecloud/aspose-html-cloud receives a total of 6 weekly downloads. As such, @asposecloud/aspose-html-cloud popularity was classified as not popular.
We found that @asposecloud/aspose-html-cloud 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.