First, go to http://www.haxenme.org/download and install NME.
Since Cordova support is a beta feature, we will continue to improve NME's support of Cordova over time. If you want, you can get the latest development build here:
http://www.haxenme.org/builds/latest/
Assuming you already installed NME using the full installer, you can update to a development build like this:
haxelib test (path to zip)
Open a terminal or command-prompt, and run:
nme setup html5
Let it install Cordova for you when it asks. The public 2.0.0 release is broken, but hopefully it will be fixed for Cordova 2.0.1.
You can build a project with Cordova by adding an "-html5" flag to the desired target. This will automatically call the "bin/create" tool for the specified Cordova platform, then the command-line tools for NME handle the compile, install and run process.
The following commands are currently supported:
nme test project.nmml blackberry -html5
nme test project.nmml blackberry -simulator -html5
nme test project.nmml blackberry -bbos -html5
nme test project.nmml ios -html5
nme test project.nmml ios -simulator -html5
Here is a project that uses only Javascript:
http://github.com/jgranick/SampleJS
Here is a project that uses Haxe, compiled to Javascript:
http://github.com/jgranick/SampleHaxeJS
Here is a sample NME project that will work for native or HTML5: