Comments (4)
trymodule looks cool. But I'm even more impressed by the colors.rainbow
function. We should definitely include it into n_
! I’ll send you a PR for lodash! 😁
Regarding the history feature: I’ve been thinking about it before because I was missing it myself in n_
. You can save the repl session into a file manually using the command .save
but that’s inconvenient.
The only aspect I don’t like about the repl.history module is that I’d have to add it as a dependency. I like n_
being dependent only on lodash. That’s why I was thinking of integrating session persistence “the native way”. Seems like I can load and save the last session using the following four lines of code:
// load the last session after server start
server.commands.load.action.apply(server, [path.join(process.env.HOME, 'n_repl_history')]);
// save the session on exit
process.on('exit', function () {
server.commands.save.action.apply(server, [path.join(process.env.HOME, 'n_repl_history')]);
});
What do you think?
from n_.
I don't mind the extra dep. The neat thing about a shared history package is that if others use it, like trymodule
, then history persists across tools which is nice.
from n_.
If there just wasn’t that incompatibility issue tmpvar/repl.history#6 ...
Anyway, you're right. A shared history between different repls would be neat. This would however require all repls to use the same file path, which currently is not guaranteed by repl.history because the file path is an option.
from n_.
👍
from n_.
Related Issues (17)
- Problem with `_` HOT 13
- Add a nice animated gif to the README.md so that anyone sees immediately what n_ is made for HOT 1
- Would love to know how to make something like this for babel-node HOT 2
- Possibility to redirect the special variable `$` elsewhere so we could use it for our own needs? HOT 1
- Upgrade to lodash 4.0 HOT 2
- The special variable $ no longer works in Node 6 HOT 1
- Allow custom lodash version HOT 12
- n_ breaks npm ls -g HOT 1
- Add note about `_` redirect to `$` in readme.
- Deprecation Warning HOT 2
- npm install does not work HOT 5
- unable to use _.toInteger() in n_ repl - how can I force lodash major version 4? HOT 3
- Error using rli prop
- Add unit tests. HOT 1
- `.clear` loses lodash binding
- Multi-line commands break lodash binding HOT 1
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 n_.