polotno-node
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -22,3 +22,10 @@ const puppeteer = require('puppeteer'); | ||
}, | ||
jsonToDataURL: async (json) => { | ||
return await instance.run(async (json) => { | ||
store.loadJSON(json); | ||
await store.waitLoading(); | ||
return store.toDataURL(); | ||
}, json); | ||
}, | ||
}; | ||
}; |
{ | ||
"name": "polotno-node", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Polotno workflow from NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,7 +13,12 @@ # Polotno-node | ||
const fs = require('fs'); | ||
const { createInstance } = require('./index'); | ||
const { createInstance } = require('polotno-node'); | ||
async function run() { | ||
// create working instance | ||
const instance = await createInstance({ key: 'nFA5H9elEytDyPyvKL7T' }); | ||
const instance = await createInstance({ | ||
// this is a demo key just for that project | ||
// (!) please don't use it in your projects | ||
// to create your own API key please go here: https://polotno.dev/cabinet | ||
key: 'nFA5H9elEytDyPyvKL7T', | ||
}); | ||
@@ -31,2 +36,4 @@ // load sample json | ||
}, json); | ||
// or the same code, but much shorter: | ||
// const url = await instance.jsonToDataURL(json); | ||
@@ -44,2 +51,3 @@ // prepare base64 string to save | ||
run(); | ||
``` |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2774927
960
2808
50
5
2