flexmonster-compressor
Advanced tools
Comparing version 2.6.2 to 2.6.3-1
{ | ||
"name": "flexmonster-compressor", | ||
"version": "2.6.2", | ||
"version": "2.6.3-1", | ||
"description": "Flexmonster Compressor for Node.js – a special server-side compression tool that helps you to increase data loading speed from server to Flexmonster Pivot Table component.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Flexmonster Compressor for Node.js | ||
Flexmonster Compressor for Node.js – a special server-side compression tool that helps you to increase data loading speed from server to (Flexmonster Pivot Table)[http://www.flexmonster.com/] component. | ||
Flexmonster Compressor for Node.js is a special server-side compression tool that helps you to increase data loading speed from server to [Flexmonster Pivot Table & Charts](https://www.flexmonster.com/?r=npm). | ||
Flexmonster Compressor can compress the data from the following sources: | ||
* MongoDB – [driver](https://www.npmjs.com/package/mongodb) | ||
* MySQL – [driver](https://www.npmjs.com/package/mysql) | ||
* PostgreSQL – [driver](https://www.npmjs.com/package/pg) | ||
* JSON files/streams | ||
* CSV files/streams | ||
# What is JS Pivot Table by Flexmonster? | ||
Flexmonster Pivot Table & Charts is a component for interactive pivot reports that can be [inserted to a web page or a web application](http://www.flexmonster.com/demos/pivot-table-js/). It’s a powerful JavaScript tool to visualize your business data. | ||
Flexmonster Pivot Table & Charts is a component for interactive pivot reports that can be [inserted to a web page or a web application](https://www.flexmonster.com/demos/pivot-table-js/?r=npm). It’s a powerful JavaScript tool to visualize your business data. | ||
Flexmonster Pivot is a cross-platform web component that seamlessly work on any browser (Chrome, Firefox, Internet Explorer, Safari or Opera) across Windows, macOS, Linux, iOS or Android. | ||
Flexmonster Pivot is a cross-platform web component that seamlessly works on any browser (Chrome, Firefox, Internet Explorer, Safari or Opera) across Windows, macOS, Linux, iOS or Android. | ||
# How to use compressor? | ||
# Why use Flexmonster Compressor? | ||
Here is an example how to create API endpoint that returns data from MongoDB: | ||
* Provide a secure connection to your database or file | ||
* Reduce data size after compression | ||
* Increase data loading speed | ||
# Installation and usage | ||
Start by installing Flexmonster Compressor as a node module and save it as a dependency in your package.json: | ||
``` | ||
npm i flexmonster-compressor --save | ||
``` | ||
Connect to the database or file and compress the data. Here is an example on how to create API endpoint that returns data from MongoDB: | ||
```javascript | ||
const compressor = require('flexmonster-compressor'); | ||
const MongoClient = require('mongodb').MongoClient; | ||
app.get('/data', (req, res) => { | ||
let dbResult = dbo.collection("my_collection").find().stream(); | ||
let outputStream = compressor.compressJsonStream(dbResult); | ||
outputStream.on('data', data => res.write(data)); | ||
outputStream.on('end', () => res.end()); | ||
MongoClient.connect("mongodb://demo:p123456@ds121251.mlab.com:21251/flexmonster", { useNewUrlParser: true }, (err, client) => { | ||
if (err) throw err; | ||
console.log("Connected successfully to MongoDB."); | ||
app.set("db", client.db("flexmonster")); | ||
}); | ||
app.get('/mongodb', (req, res) => { | ||
const db = req.app.get('db'); | ||
const result = db.collection('sample_data').find({}, { projection: { '_id': false } }).stream(); | ||
let stream = compressor.compressJsonStream(result); | ||
stream.on('data', data => res.write(data)); | ||
stream.on('end', () => res.end()); | ||
}); | ||
``` | ||
Then, on the font-end, you can use this endpoint to connect Flexmonster Pivot Table as follows: | ||
To get the data on the front-end, please use the following code: | ||
```javascript | ||
var pivot = new Flexmonster({ | ||
report: { | ||
dataSource: { | ||
dataSourceType: "ocsv", | ||
filename: "http://your_api_host/data" | ||
} | ||
} | ||
}); | ||
``` | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Demo</title> | ||
<link href="https://cdn.flexmonster.com/flexmonster.min.css" rel="stylesheet" type="text/css"> | ||
<script type="text/javascript" src="https://cdn.flexmonster.com/flexmonster.js"></script> | ||
</head> | ||
<body> | ||
<div id="pivot"></div> | ||
<script type="text/javascript"> | ||
new Flexmonster({ | ||
container: "#pivot", | ||
componentFolder: "https://cdn.flexmonster.com/", | ||
report: { | ||
dataSource: { | ||
dataSourceType: "ocsv", | ||
filename: "/mongodb" | ||
} | ||
} | ||
}) | ||
</script> | ||
</body> | ||
</html> | ||
``` | ||
# Examples | ||
The sample project can be found at [GitHub](https://github.com/flexmonster/pivot-compressor-nodejs/). | ||
Also you can get all support from development team on [Forum](https://www.flexmonster.com/forum/?r=npm). Flexmonster developers react fast to the questions and provide professional assistance. |
module.exports = { | ||
VERSION: "2.6.2", | ||
VERSION: "2.6.3", | ||
VERSION_COMPATIBLE: "2.213" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
196997
0
83
2