Skip to content

Commit

Permalink
Support for newer Babel and work-around the following Node 7.x bug:
Browse files Browse the repository at this point in the history
nodejs/node#11257

Instead of piping the output to node, create a temporary file.
  • Loading branch information
antun committed May 16, 2017
1 parent acde391 commit 084bef2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ndebug.js
ndebug_compiled.js
node_modules
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Purpose
-------

This fork works around the bug where [redirecting Node to a pipe breaks require](https://github.com/nodejs/node/issues/11257). It is also updated for Node v7.10, with the newer syntax.

This is a repo and workflow for a simple ES6/Node.js/Lodash scratchpad for Vim. I got tired of writing bits of code in the
web inspector, since it's really difficult to go back and edit code. I wanted a quick little thing I could open up
and immediately start writing some ES6 code that also has Lodash available.
Expand All @@ -27,3 +29,13 @@ buffer remains until I close it, and it'll update each time I save the scratchpa
scratchpad buffer:

![http://i.nick.sg/image/2i2N2E1B0j25/gif.gif](http://i.nick.sg/image/2i2N2E1B0j25/gif.gif)

Alternatively, I use this setup, which lets me write :_ in vim and hit enter:

```
au BufWritePost ndebug.js execute "normal! :Clam cd ~/software/git/ndebug; npm run build; cd -\<cr>"
function! Ndebug()
:edit ~/software/git/ndebug/ndebug.js
endfunction
cnoremap _<CR> <CR>:call Ndebug()<CR><CR>
```
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
"description": "An ES6/Node.js scratchpad for Vim with lodash available.",
"main": "index.js",
"scripts": {
"build": "babel ndebug.js|node",
"build": "babel ndebug.js > ndebug_compiled.js; node ndebug_compiled.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nicksergeant/ndebug.git"
"url": "git+https://github.com/antun/ndebug.git"
},
"author": "Nick Sergeant",
"license": "MIT",
"bugs": {
"url": "https://github.com/nicksergeant/ndebug/issues"
"url": "https://github.com/antun/ndebug/issues"
},
"homepage": "https://github.com/nicksergeant/ndebug#readme",
"homepage": "https://github.com/antun/ndebug#readme",
"dependencies": {
"babel": "^5.8.23",
"lodash": "^3.10.1"
"babel-cli": "^6.24.1",
"lodash": "^4.17.4"
}
}

0 comments on commit 084bef2

Please sign in to comment.