Socket
Socket
Sign inDemoInstall

pxm2png

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pxm2png

Node wrapper for Automator task for Pixelmator to PNG file conversion


Version published
Weekly downloads
2
Maintainers
1
Install size
1.65 MB
Created
Weekly downloads
 

Readme

Source

Automator task and example gruntfile for Pixelmator conversions using grunt watch

Based on http://www.mrspeaker.net/2013/07/29/pixelmator-save-project-reload/

Example usage with grunt:

Gruntfile.js

var pxm2png = require('pxm2png');
var path = require('path');
module.exports = function(grunt) {
  grunt.initConfig({
    watch: {
      pxm: {
        files   : ['**/*.pxm'],
        tasks   : ['pxm2png'],
        options : { spawn: false },
        modified: []
      }
    }
  });
 
  grunt.registerTask('pxm2png', 'convert Pixelmator files to pngs', function() {
    var tool = path.join(__dirname, 'workflow/pxm2png/pxm2png.app');
    var target = path.join(__dirname, grunt.config("pxm.modified")[0]);
    grunt.log.writeln('Converting pxm file: ' + target);
    var cp = grunt.util.spawn({
      cmd: 'open', args: [ pxm2png.app, '--args', target ]
    }, function (err, res, code) {
      if (err) throw err.stack;
      if (code == 0) return;
      grunt.log.writeln("Error converting .pxm file:", target, res.stderr);
    });
  });
 
  // Set the pxm file changed to be retrieved by pxm2png task
  grunt.event.on('watch', function(action, filepath) {
    if (grunt.file.isMatch('**/*.pxm', filepath)) {
      grunt.config("pxm", { modified: [filepath] })
    }
  });
 
  // Load plugin
  grunt.loadNpmTasks('grunt-contrib-watch');
 
  // Default task(s).
  grunt.registerTask('default', []);
};

FAQs

Last updated on 15 Mar 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc