Skip to content

Commit

Permalink
auto parse .json.ls, closes #884
Browse files Browse the repository at this point in the history
  • Loading branch information
gkz committed May 15, 2016
1 parent 2eb2aad commit 2f7876b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
18 changes: 12 additions & 6 deletions lib/node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/node.ls
Expand Up @@ -29,7 +29,11 @@ module.exports = !(LiveScript) ->
LiveScript <<<< events.EventEmitter.prototype

require.extensions.'.ls' = (module, filename) ->
js = LiveScript.compile (fs.read-file-sync filename, 'utf8'), {filename, +bare, map: "embedded"} .code
file = fs.read-file-sync filename, 'utf8'
js = if '.json.ls' is filename.substr -8
'module.exports = ' + LiveScript.compile file, {filename, +json}
else
LiveScript.compile file, {filename, +bare, map: "embedded"} .code
try
module._compile js, filename
catch
Expand Down

0 comments on commit 2f7876b

Please sign in to comment.