Skip to content

Commit 706853b

Browse files
committed
Merge remote branch 'gozala/master'
Conflicts: README.md
2 parents 3ad23e4 + ac5f80f commit 706853b

File tree

3 files changed

+74
-27
lines changed

3 files changed

+74
-27
lines changed

README.md

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,35 +56,28 @@ will be eventually added.
5656
Installation
5757
------------
5858

59-
1. Install [Node.JS](http://nodejs.org), [npm](http://npmjs.org/) and
60-
then [Socket.IO](http://socket.io/):
61-
62-
npm install socket.io
63-
2. Get recent [SLIME](http://common-lisp.net/project/slime/) from its CVS
64-
or the [git mirror](http://git.boinkor.net/gitweb/slime.git). The backend
65-
was verified to work with SLIME 2012-02-12, it may or may not work with
66-
other versions, but note that breaking change in the protocol was introduced
67-
in SLIME 2011-11-27.
68-
3. Make sure you have latest [js2-mode](http://code.google.com/p/js2-mode/).
69-
Add it to your .emacs:
70-
71-
(add-to-list 'load-path "/path/to/js2-mode/directory")
72-
(autoload 'js2-mode "js2-mode" nil t)
73-
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
74-
3. Create symbolic link to slime-js.el in the contrib subdirectory of
75-
SLIME project.
59+
1. Install [Node.JS](http://nodejs.org) and [npm](http://npmjs.org/)
60+
2. Install swank-js from npm:
61+
62+
npm install -g swank-js
63+
64+
3. Install [slime-js](https://github.com/Gozala/slime-js) into emacs from
65+
http://marmalade-repo.org
66+
67+
M-x package-install slime-js
68+
69+
3. Install [js2-mode](http://code.google.com/p/js2-mode/) into emacs from
70+
http://tromey.com/elpa/
71+
7672
4. In your .emacs, add the following lines (you may use other key for
7773
slime-js-reload; also, if you're already using SLIME, just add slime-js
7874
to the list of contribs, otherwise adjust the load-path item):
7975

80-
(add-to-list 'load-path "/path/to/slime/installation")
81-
(require 'slime)
82-
(slime-setup '(slime-repl slime-js))
83-
8476
(global-set-key [f5] 'slime-js-reload)
8577
(add-hook 'js2-mode-hook
8678
(lambda ()
8779
(slime-js-minor-mode 1)))
80+
8881
5. If you're using CSS mode, you may want to add the following lines too:
8982

9083
(add-hook 'css-mode-hook
@@ -95,13 +88,32 @@ to the list of contribs, otherwise adjust the load-path item):
9588
Usage
9689
-----
9790

98-
Start swank-js with the following command in the project directory:
91+
If you want to use swank from the node project just add following to your
92+
package.json file:
93+
94+
"devDependencies": {
95+
"swank-js": ">=0.0.1"
96+
},
97+
"scripts": {
98+
"swank": "node node_modules/swank-js"
99+
}
100+
101+
Once this is done you should be able to run up a swank for this project by
102+
running:
103+
104+
npm run swank
105+
106+
Alternatively you can install swank-js globally by running:
107+
108+
npm install -g swank-js
109+
110+
Once installed you could run it from you project directory:
99111

100-
node swank.js
112+
swank-js
101113

102-
Make SLIME connect to the backend using M-x slime-connect and
103-
specifying localhost and port 4005. You will see REPL buffer with the
104-
following prompt:
114+
Make SLIME connect to the backend using `M-x slime-connect` and
115+
specifying `localhost` and port `4005`. You will see REPL buffer
116+
with the following prompt:
105117

106118
NODE>
107119

package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "swank-js",
3+
"version": "0.0.1",
4+
"description": "Asynchronously recursive, pure function <3 via lazy streams.",
5+
"keywords": [ "swank", "slime", "emacs", "repl" ],
6+
"author": "Ivan Shvedunov",
7+
"contributors": [
8+
"Robert Krahn",
9+
"Irakli Gozalishvili <[email protected]>"
10+
],
11+
"homepage": "https://github.com/ivan4th/swank-js",
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/ivan4th/swank-js.git",
15+
"web": "https://github.com/ivan4th/swank-js"
16+
},
17+
"bugs": {
18+
"url": "https://github.com/ivan4th/swank-js/issues/"
19+
},
20+
"main": "./swank.js",
21+
"bin": {
22+
"swank-js": "./swank.js"
23+
},
24+
"dependencies": {
25+
"socket.io": ">=0.8.7"
26+
},
27+
"scripts": {
28+
"swank": "node ./swank.js"
29+
},
30+
"licenses": [{
31+
"type" : "X11-style",
32+
"url" : "https://raw.github.com/ivan4th/swank-js/master/LICENSE"
33+
}]
34+
}

swank.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
// -*- mode: js2 -*-
23
//
34
// Copyright (c) 2010 Ivan Shvedunov. All rights reserved.
@@ -456,4 +457,4 @@ io.sockets.on(
456457
// TBD: handle/add X-Forwarded-For headers
457458
// TBD: fix all assert calls: we need (actual, expected) not (expected, actual)
458459
// TBD: invoke SwankJS.setup() only when DOM is ready (at least in IE)
459-
// TBD: timeouts for browser requests
460+
// TBD: timeouts for browser requests

0 commit comments

Comments
 (0)