polotno-node 2.4.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -231,6 +231,28 @@ const url = await instance.run(async (json) => {
231
231
  }, json);
232
232
  ```
233
233
 
234
+ ## Video export
235
+
236
+ **This part is currently under development and API will change.**
237
+
238
+ ```js
239
+ import { createInstance } from 'polotno-node';
240
+ import { jsonToVideo } from 'polotno/video';
241
+
242
+ // create working instance
243
+ const instance = await createInstance({
244
+ key: '...key...',
245
+ });
246
+
247
+ // load sample json
248
+ const json = JSON.parse(fs.readFileSync('./test-data/video.json'));
249
+ const page = await instance.createPage();
250
+
251
+ await jsonToVideo(page, json, { out: 'out.mp4' });
252
+
253
+ await instance.close();
254
+ ```
255
+
234
256
  ## Your own client
235
257
 
236
258
  By default `polotno-node` ships with the default Polotno Editor with its (hopefully) last version. If you use experimental API such as `unstable_registerShapeModel` and `unstable_registerShapeComponent`, the rendering may fail if you use unknown elements types.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polotno-node",
3
- "version": "2.4.2",
3
+ "version": "2.5.0",
4
4
  "description": "Polotno workflow from NodeJS",
5
5
  "main": "index.js",
6
6
  "scripts": {