Narcoleptic's Patch Mangler

    grunt-espruino

    0.1.4 • Public • Published

    grunt-espruino

    Deploy code to an espruino microcontroller as part of a grunt setup.

    Getting Started

    This plugin requires Grunt ~0.4.0

    If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

    npm install grunt-espruino --save-dev

    Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

    grunt.loadNpmTasks('grunt-espruino');

    Espruino task

    Run this task with the grunt espruino command.

    Settings

    There are a number of options available. Either boardSerial or port must be supplied, as well as file:

    boardSerial

    Type: String

    This defines the manufacturer serial number of the board that we are deploying to. Can be pulled from the board over serial using getSerial() function.

    port

    Type: String

    This defines the serial port that you want to deploy to. Not as fancy as using boardSerial but it works.

    file

    Type: String

    Path to the file that you want deployed.

    listen

    Type: Boolean

    Whether to leave the serial connection open after deploy and listen.

    watch

    Type: Boolean

    If true watches file for any changes and redeploys.

    save

    Type: Boolean

    If true uploaded code is saved to the espruinos flash. Set to false when in development for much shorter deploy times.

    Examples

    // Simple config to deploy to a single board
    grunt.module.exports = function(grunt) {
      grunt.initConfig({
        espruino: {
          upPin: {
            boardSerial: '33FFD605-41573033-15720843',
            file: 'upPin.espr.js'
          }
        }
      });
     
      grunt.loadNpmTasks('grunt-espruino');
     
      grunt.registerTask('default', ['espruino']);
    }
    // Development config, doesnt save so that deploys are faster. Watches for any changes and redeploys.
    grunt.module.exports = function(grunt) {
      grunt.initConfig({
        espruino: {
          upPin: {
            boardSerial: '33FFD605-41573033-15720843',
            file: 'upPin.espr.js',
            save: false,
            watch: true
          }
        }
      });
     
      grunt.loadNpmTasks('grunt-espruino');
     
      grunt.registerTask('default', ['espruino']);
    }

    Keywords

    none

    Install

    npm i grunt-espruino

    DownloadsWeekly Downloads

    1

    Version

    0.1.4

    License

    MIT

    Last publish

    Collaborators

    • voiceofwisdom