Setting up NPM command line usage of TiddlyWiki

This commit is contained in:
Jeremy Ruston 2012-07-13 18:17:46 +01:00
parent 898e86db79
commit e451f2398e
3 changed files with 10 additions and 2 deletions

View File

@ -33,6 +33,7 @@ In practice, each module is wrapped in a separate script block.
// Set up $tw global for the server // Set up $tw global for the server
if(typeof(window) === "undefined" && !global.$tw) { if(typeof(window) === "undefined" && !global.$tw) {
global.$tw = {}; // No ``browser`` member for the server global.$tw = {}; // No ``browser`` member for the server
exports.$tw = $tw;
} }
// Temporary switch for replacing the old wiki text parser with the new one // Temporary switch for replacing the old wiki text parser with the new one

7
core/cli.js Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env node
/*
This is invoked as a shell script by NPM when the `tiddlywiki` command is typed
*/
var tiddlywiki = require("./boot.js");

View File

@ -1,7 +1,7 @@
{ {
"name": "tiddlywiki", "name": "tiddlywiki",
"preferGlobal": "true", "preferGlobal": "true",
"version": "5.0.0-alpha.4", "version": "5.0.0-alpha.7",
"author": "Jeremy Ruston <jeremy@jermolene.com>", "author": "Jeremy Ruston <jeremy@jermolene.com>",
"description": "a reusable non-linear personal web notebook", "description": "a reusable non-linear personal web notebook",
"contributors": [ "contributors": [
@ -11,7 +11,7 @@
} }
], ],
"bin": { "bin": {
"tiddlywiki": "./core/boot.js" "tiddlywiki": "./core/cli.js"
}, },
"main": "./core/boot.js", "main": "./core/boot.js",
"repository": { "repository": {