![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
mokuai-coffee
Advanced tools
Makes your CoffeeScript mokuai-able.
Mokuai lets you write pure JavaScript modules, without any concern about concatenation order and require calls.
Mokuai-coffee works with your CoffeeScript to create a mokuai closure.
Plus, if you want to mix JavaScript and CoffeeScript mokuai modules, you can use the extra-feature partial, which only compiles you CoffeeScript into mokuai modules, without wrappping them into a mokuai closure, so you can use it as a prepend / append file in original mokuai.
If you want to use the mokuai-coffee cli, install it globally via npm:
$ npm install mokuai-coffee --global
Then you can use the mokuai-coffee
command, as follow:
$ mokuai-coffee --help
Usage: mokuai-coffee <[modulename:]file ...> [options]
Wrap your CoffeeScript modules with mokuai.
If the --output (-o) option is not used, the result is printed into the console.
Modules are automatically named after files basenames (path/to/file.coffee => file).
Files can also be prefixed by a custom module name and a colon (custom:path/to/file.js => custom).
Options:
-h, --help output usage information
-V, --version output the version number
-p, --prepend <value> (repeatable) add the <value> file to prepended files (files that are prepended to modules)
-a, --append <value> (repeatable) add the <value> file to appended files (files that are appended to modules)
-e, --exports [value] define the exports mokuai-coffee option ([value] is optional and can be either false, true or any module name)
-n, --exportsname <value> set the exportsname mokuai-coffee option to <value>
-A, --autoexports set the autoexports mokuai-coffee option to true
-P, --partial set the partial mokuai-coffee option to true (do not wrap to mokuai closure, i.e. do it manually with original mokuai)
-o, --output <output> set the output file (if not set, print the result in the console)
Examples:
$ mokuai-coffee path/to/module.coffee customname:path/to/another/module.coffee
$ mokuai-coffee <files> --output gen/app.js
$ mokuai-coffee <files> --partial --output gen/app.js
$ mokuai-coffee <files> --exports --output gen/app.js
$ mokuai-coffee <files> --exports --exportsname MyApp --output gen/app.js
$ mokuai-coffee <files> --exports AppModule --exportsname MyApp --output gen/app.js
$ mokuai-coffee <files> --exports MainModule --exportsname MyApp --output gen/app.js
$ mokuai-coffee <files> --append prepare.coffee --append launch.coffee --autoexports --output gen/app.js
$ mokuai-coffee <files> --prepend prepend.coffee --append append.coffee --exports --output gen/app.js
Modules are automatically named after files basenames, unless you prefix the filepath with a custom name followed by a colon.
For example:
$ mokuai-coffee path/to/module.coffee customname:path/to/another/module.coffee --output closure.js
will create 2 modules named module
and customname
.
prepend / append options are repeatable:
$ mokuai-coffee <files> --prepend prepend1.coffee --prepend prepend2.coffee --append append1.coffee --append append2.coffee
If you want to create a partial file, simply pass the partial option:
$ mokuai-coffee <files> --output closure.js --partial
If you want to use the library in a Node.js project, install it locally via npm:
$ npm install mokuai-coffee
or save it as a dev dependency, adding the --save-dev
option:
$ npm install mokuai-coffee --save-dev
Then, you can just require mokuai-coffee
in your code and use it as follow.
var mokuaiCoffee = require('mokuai-coffee');
var closure = mokuai({
moduleName1: 'moduleContent1',
moduleName2: 'moduleContent2',
// ...
moduleNameN: 'moduleContentN'
}, {
prepend: [
'prependContent1',
'prependContent2',
// ...
'prependContentN'
],
append: [
'appendContent1',
'appendContent2',
// ...
'appendContentN'
],
autoexports: false,
exports: 'moduleName1',
exportsname: 'MyCustomExportsName',
});
// DO whatever you want with 'closure'
If you want to compile the modules without wrappipng the result to a mokuai closure, add the partial options:
var mokuaiCoffee = require('mokuai-coffee');
var partial = mokuai({
moduleName1: 'moduleContent1',
moduleName2: 'moduleContent2',
// ...
moduleNameN: 'moduleContentN'
}, {
prepend: [
'prependContent1',
'prependContent2',
// ...
'prependContentN'
],
append: [
'appendContent1',
'appendContent2',
// ...
'appendContentN'
],
autoexports: false,
exports: 'moduleName1',
exportsname: 'MyCustomExportsName',
partial: true
});
// Do whatever you want with 'partial'
If you want to compile from filepaths instead of modules contents:
var mokuaiCoffee = require('mokuai-coffee');
var closure = mokuai.fromFiles({
moduleName1: 'path/to/module1.coffee',
moduleName2: 'path/to/module2.coffee',
// ...
moduleNameN: 'path/to/moduleContentN.coffee'
}, {
prepend: [
'path/to/prependContent1.coffee',
'path/to/prependContent2.coffee',
// ...
'path/to/prependContentN.coffee'
],
append: [
'path/to/appendContent1.coffee',
'path/to/appendContent2.coffee',
// ...
'path/to/appendContentN.coffee'
],
autoexports: false,
exports: 'moduleName1',
exportsname: 'MyCustomExportsName'
});
// Do whatever you want with 'closure'
FAQs
Makes your CoffeeScript mokuai-able.
The npm package mokuai-coffee receives a total of 0 weekly downloads. As such, mokuai-coffee popularity was classified as not popular.
We found that mokuai-coffee demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.