First, go to http://www.haxenme.org/download and install NME.
Since Cordova support is only in development builds, you will need to update your copy of the NME library. You still want to use the installer above, because it installs the dependencies in one step.
You can get the latest development build here:
http://www.haxenme.org/builds/latest/
Then you can update your local install 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: