Permalink
Browse files

update readme/todo

  • Loading branch information...
1 parent b300894 commit a9ddb96dc0ee76ac5dade0dea295bf7aefb94c7a @contra committed Sep 16, 2011
Showing with 23 additions and 15 deletions.
  1. +5 −1 README.md
  2. +6 −4 TODO.md
  3. +11 −8 src/modules/fs.coffee
  4. +1 −2 src/require.coffee
View
@@ -10,7 +10,11 @@ Using Nova is as simple as including nova.js on your web page. Please not that N
Nova currently supports the following NodeJS modules:
```
-None yet :(
+events - 100%
+util - 100%
+sys - 25%
+readline - 85% (All console management functionality does nothing though)
+fs - 50%
```
## Examples
View
10 TODO.md
@@ -2,10 +2,12 @@
### Minor
- * Complete all NodeJS modules (obviously)
- * Set up some form of testing
+ * fs - chmod, stat, watching, directory, and stream
+ * readline - route all non-working console methods to null
+ * sys - map out all functionality
### Major
- * Perfect build process
- * Try to get rid of all 3rd party dependencies (especially jQuery)
+ * fs - construct file/directory models with access times and all for localstorage. spoof any unavailable data
+ * http - write async/sync ajax functionality
+ * Replace superagent with built-in http module
View
@@ -3,9 +3,7 @@ require.register 'fs', (module, exports, require) ->
LOCAL_STORAGE_NOT_FOUND = new Error 'browser does not support localStorage'
module.exports =
- # Any file writes/deletes/creations will take place in local storage
- # Any file reads will try local storage and then ajax request from base URL if no file is found
-
+ # Attempts localStorage and then ajax request from base URL if no file is found
readFile: (filename, callback) ->
if localStorage?
contents = localStorage.getItem filename
@@ -21,26 +19,31 @@ require.register 'fs', (module, exports, require) ->
callback new Error('ENOENT, The system cannot find the file specified. ' + filename), null
return
return
-
+
+ # Only supports localStorage
readFileSync: (filename) ->
if !localStorage then throw LOCAL_STORAGE_NOT_FOUND
return JSON.parse localStorage.getItem(filename)
-
+
+ # Only supports localStorage
writeFile: (filename, data, encoding, callback) ->
callback or= encoding
if !localStorage then callback
localStorage.setItem filename, JSON.stringify(data)
if callback?
callback null
return
-
+
+ # Only supports localStorage
writeFileSync: (filename, data, encoding) ->
if !localStorage then throw LOCAL_STORAGE_NOT_FOUND
localStorage.setItem filename, JSON.stringify(data)
return
-
+
+ # Only supports localStorage
# watchFile: (filename, options, callback) ->
-
+
+ # Only supports localStorage
rename: (oldf, newf, callback) ->
if !localStorage then throw LOCAL_STORAGE_NOT_FOUND
contents = localStorage.getItem oldf
View
@@ -2,11 +2,10 @@
require = (name) ->
module = require.modules[name]
throw 'module ' + name + ' does not exist' unless module
- unless module.exports
+ unless module.exports # ghetto-caching
module.exports = {}
module.call module.exports, module, module.exports, require(name)
return module.exports
require.modules = {}
-
require.register = (name, fn) -> require.modules[name] = fn

0 comments on commit a9ddb96

Please sign in to comment.