diff --git a/.gitignore b/.gitignore index 9111c6c..d6239c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Built files *.js +!index.js !binding.js *.map *.d.ts diff --git a/packages/css/lib/index.js b/packages/css/lib/index.js new file mode 100644 index 0000000..29baada --- /dev/null +++ b/packages/css/lib/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.minify = void 0; +const binding = require("./binding"); +async function minify(content, options) { + return binding.minify(content, toBuffer(options)); +} +exports.minify = minify; +function toBuffer(t) { + return Buffer.from(JSON.stringify(t)); +} diff --git a/packages/html/lib/index.js b/packages/html/lib/index.js new file mode 100644 index 0000000..29baada --- /dev/null +++ b/packages/html/lib/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.minify = void 0; +const binding = require("./binding"); +async function minify(content, options) { + return binding.minify(content, toBuffer(options)); +} +exports.minify = minify; +function toBuffer(t) { + return Buffer.from(JSON.stringify(t)); +}