cep-json

Quick and dirty async function to evalScript Douglas Crockford's json2.js for Adobe CEP panels and polyfill support for JSON.stringify() and JSON.parse() within Adobe scripting

Usage no npm install needed!

<script type="module">
  import cepJson from 'https://cdn.skypack.dev/cep-json';
</script>

README

CEP-JSON

Quick and dirty async function to evalScript Douglas Crockford's json2.js for Adobe CEP panels and polyfill support for JSON.stringify() and JSON.parse() within Adobe scripting

# installation
npm i CEP-JSON
import loadJSON from "cep-json";
// OR:
const loadJSON = require("cep-json").default;

// Usage within async/await
await loadJSON();

// Usage as thenable
loadJSON().then(() => {
  console.log(
    "JSON is loaded, you can now invoke JSON.parse and JSON.stringify through any JSX/evalScript call."
  );
});

NOTE:

  • This package uses the evalScript() method from the workaround package, which may not work in a custom panel of your own when run from within <iframe> elements unless you follow the steps outlined in workaround's README (to use an event chain for bypassing CORS restrictions in newest versions of Adobe apps)