Keystrokes:
umdp<Tab>foo
Output:
(function (root, factory) {
// Node
if (typeof exports === 'object') {
module.exports = factory();
}
// AMD
else if (typeof define === 'function' && define.amd) {
define(factory);
}
// Export to global
else {
root.foo = factory();
}
}(this, function () {
// Exported module API
return {};
}));
Keystrokes:
umdp<Tab>foo<C-j>bar
Output:
(function (root, factory) {
// Node
if (typeof exports === 'object') {
module.exports = factory(
require('bar')
);
}
// AMD
else if (typeof define === 'function' && define.amd) {
define([
'bar'
], factory);
}
// Export to global
else {
root.foo = factory(
root.bar
);
}
}(this, function (bar) {
// Exported module API
return {};
}));
Keystrokes:
umdp<Tab>foo<C-j>bar, baz, bam
Output:
(function (root, factory) {
// Node
if (typeof exports === 'object') {
module.exports = factory(
require('bar')
, require('baz')
, require('bam')
);
}
// AMD
else if (typeof define === 'function' && define.amd) {
define([
'bar'
, 'baz'
, 'bam'
], factory);
}
// Export to global
else {
root.foo = factory(
root.bar
, root.baz
, root.bam
);
}
}(this, function (bar, baz, bam) {
// Exported module API
return {};
}));