Skip to content

Instantly share code, notes, and snippets.

@jcreamer898
Created October 1, 2012 17:20
Show Gist options
  • Save jcreamer898/3813146 to your computer and use it in GitHub Desktop.
Save jcreamer898/3813146 to your computer and use it in GitHub Desktop.
anvil.js plugin boilerplate

anvil.js plugins

In this gist there's a plugin.js boilerplate for creating a new anvil plugin.

Also, there's a sublime snippet for the SB Text users out there.

<snippet>
<content><![CDATA[
var pluginFactory = function( _, anvil ) {
return anvil.plugin( {
// Name your plugin
name: "anvil.${1:PluginName}",
// Activity list: "identify", "pull", "combine", "pre-process","compile", "post-process", "push", "test"
activity: "post-process",
// Command all the things [ "-s, --somecommand", "Run this plugin for awesomesauce" ]
commander: [],
// Configure all the things...
configure: function( config, command, done ) {
done();
},
// Run all the things...
run: function( done ) {
done();
}
} );
};
module.exports = pluginFactory;
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>anvilp</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
var pluginFactory = function( _, anvil ) {
return anvil.plugin( {
// Name your plugin
name: "anvil.somePlugin",
// Activity list: "identify", "pull", "combine", "pre-process","compile", "post-process", "push", "test"
activity: "post-process",
// Command all the things [ "-s, --somecommand", "Run this plugin for awesomesauce" ]
commander: [],
// Configure all the things...
configure: function( config, command, done ) {
done();
},
// Run all the things...
run: function( done ) {
done();
}
} );
};
module.exports = pluginFactory;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment