Comments (8)
I think you want something like https://github.com/laverdet/node-fibers
I made a nesh plugin https://github.com/ccheever/nesh-fibrous that let's you do things like
fibrous-coffee> User.fromId('3be25495-30c0-4ac1-9841-14965496c63d', (err, result) -> console.log result); 0
0
fibrous-coffee> { props:
{ __createdTime__: 1388723937299,
__lastUpdatedTime__: 1393627323048,
id: '3be25495-30c0-4ac1-9841-14965496c63d',
name: 'Charlie Cheever',
photoUrl: 'http://650x-us-standard.s3-website-us-east-1.amazonaws.com/misc-jpeg/HiRbF4xwQSO1pMvx_TnXCw.jpeg' },
__syncedTime__: 1394497060524 }
undefined
fibrous-coffee> cdc = User.sync.fromId('3be25495-30c0-4ac1-9841-14965496c63d')
{ props:
{ __createdTime__: 1388723937299,
__lastUpdatedTime__: 1393627323048,
id: '3be25495-30c0-4ac1-9841-14965496c63d',
name: 'Charlie Cheever',
photoUrl: 'http://650x-us-standard.s3-website-us-east-1.amazonaws.com/misc-jpeg/HiRbF4xwQSO1pMvx_TnXCw.jpeg' },
__syncedTime__: 1394497084108 }
fibrous-coffee>
from nesh.
The original question was even simpler than that, but this is awesome!
I installed this plugin and now the console is much better to work with, thanks very much!
from nesh.
Thanks @ccheever. Glad you guys got this working nicely 👍
from nesh.
console.log(require('util').inspect(result))
is the answer to your original question, btw.
from nesh.
BTW, the util
module should be available in the global scope by default, so there's no need to require
it:
console.log(util.inspect(result));
from nesh.
Thanks @ccheever , but that's still not quite the same.
See the difference between the first and the second commands: it looks like util.inspect
is converting the object into a string, and using with console.log
it loses the colors.
from nesh.
http://nodejs.org/api/util.html#util_customizing_util_inspect_colors
nesh> console.log(util.inspect({1:2},{colors:true}))
{ '1': 2 }
from nesh.
ah! That's the one!
from nesh.
Related Issues (20)
- Combining babel and eval leads to a syntax error in eval HOT 2
- How do I get global variables within nodejs
- Upgrade to babel 6 HOT 1
- Unable to require module inside eval file
- multi line for babel ?
- wished feature: multi line editing in history
- Error in plugin history: // > Error: ENOENT: no such file or directory,
- Integrate promirepl HOT 2
- Error Running nesh --plugins or --enable or --disable
- nesh crashes when tab completing at certain place
- async await support
- refactor to use es6/7
- Cryptic error when loading a module with babel HOT 3
- Cursor up in Windows git bash does not cycle history items
- Is there a way to set the history file without writing code? HOT 1
- coffeescript 2 ? HOT 1
- Good job
- Why method introspection does not work? HOT 2
- Debugger / --inspect ? HOT 1
- Is this project still active? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nesh.