Comments (8)
looking in app.js further, this would be far more ideal than interacting directly with process.std*, it'd be much more readable.
from nodebb.
Nice -- I was not aware of the commander module. Will integrate for the next release.
from nodebb.
Also worth considering is nconf - it's a bit heavier and lacks the prompting, but provides a mixture of configuration methods.
https://github.com/flatiron/nconf
That means you'd also have defaults, hierarchies, ENV variables, etc.
from nodebb.
Merged into master
at 3c62b86 from branch nconf
(since deleted)
from nodebb.
Candidate for path.join
imo.
Better written as templates.ready(webserver.init)
; don't need to pass a function to call a function when all we need is a callable. Won't need to waste the memory.
You might as well use both nconf and commander here - specifically here, commander would be the ideal.
Relevant:
https://github.com/visionmedia/commander.js/#promptmsg-fn
https://github.com/visionmedia/commander.js/#passwordmsg-mask-fn
Also look into async.series using an object for storing functions - each function would then be your ask() call, and you'd get away from indent hell that way. Would look far cleaner and easier to read.
Look into node-validator / express-validator for a better method of email validation.
Rather than defining default configs here, why not do so at the top of the file beside this?
Relevant, https://github.com/flatiron/nconf#hierarchical-configuration - look at nconf.defaults()
Other than that, looking like a decent improvement.
from nodebb.
Thanks,
Re: indent hell - I've actually taken out all of the nested ask
s and placed them inside an async.eachSeries
in /src/install.js
: https://github.com/designcreateplay/NodeBB/blob/3feb977cc44a695dc5d35305c60cbdb1f6b8d60d/src/install.js#L39
As for nconf.defaults()
, I wasn't 100% sure whether I could use nconf.save()
, since the way I understand, it saves the entire config contents into the file, including other values that are nconf.set
-ed. It isn't a problem now, but if I were to update the current admin configs (themes, motd, etc) to use nconf-redis
, then I'm not exactly sure what would be saved where. Let me know if I am wrong...
The latest commit has the defaults defined in install.js
as well: 3c62b86#L6R17
from nodebb.
commander
should be good, especially with the prompt
method.
from nodebb.
@julianlam regarding nconf-redis, that is something of which I am not familiar with.
I would suggest asking the developer straight up about the behavior.
from nodebb.
Related Issues (20)
- flagged profiles do not show up on the account info page
- "unmuted" and "unbanned" records on the account info
- Posts don't appear in user posts list if cid is -1 HOT 1
- fullname/displayname is escaped when sent via ActivityPub
- Send urls captured by `link-preview` plugin into `attachment` property via `mocks.note` HOT 1
- better unblock UX
- Save note urls in post hash HOT 2
- Skip value must be non-negative, but received: -1 HOT 1
- Images detected in posts should be added to attachments
- Unable to recover account when hCaptcha not loading HOT 3
- Relative URLs need to be rewritten to be absolute when federated out
- World (Curated) & World (All) menu items for Guests HOT 2
- remote ActivityPub representation of Category "avatars" HOT 2
- wrong css added around the url in remote fediverse post
- Invalid request, anonymous access is not allowed in place of poll box HOT 1
- Block ActivityPub user to hide opening post
- `Flag(Note)`
- Plugin hook for `Topics.updateTopicTags`
- Local & ActivityPub accounts by the same user HOT 2
- user mentions in chat rooms not working 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 nodebb.