UNPKG

texttojsxbin

Version:

Encode selected text to JSXBIN and put inside eval

18 lines (12 loc) 387 B
const { single, multi, init, destroy, t2j, t2f } = require("../out"); init(); init()()(); let jsxbin = t2j(`alert('哈哈哈哈')`); console.log("jsxbin", jsxbin); let jsxbin2 = t2j(["1", "2", "3", "4"]); console.log("jsxbin", jsxbin2); t2f("./hahah.min.jsx", `alert('哈哈哈哈');`,function(err){ if (err) return 'hhah' console.log('finished!'); }); destroy()();