totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

totaljs as a library #733

Closed buzzeins closed 5 years ago

buzzeins commented 5 years ago

Hi, one more thing :D

How would I use TotalJS (first of all F.Utils, Defs, NOSQL, and so on) within another cli (commander.js, enquirer.js) application? In this case, I won't need a webserver (and classic MVC), just F.* instead.

thx

petersirka commented 5 years ago

You can use it without any problem. Just perform require('total.js'). Then U., F. and other methods will work.

TemaSM commented 5 years ago

@petersirka what do you think about fact that Total.js mutating global object? Maybe mutating String and others prototypes not bad, but in my opinion modifying global object is not so good practice, because something like ES6 Modules more better to use. That's the main reason why sometimes I can't use Total.js for some projects, where global mutations prohibited or unavailable because some of globals already (with the same names as in Total) defined before requiring Total.js.

petersirka commented 5 years ago

@TemaSM I don't see any problem with mutating global object. For example, in web browser is global object window and it stores in most cases everything. I use only the power of JS with all benefits :-) Global is same object like many others, it's root of all - nothing more, nothing less.

You can write me which global references already exist. BTW: I use strange names and v4 will remove a lot of older global references.

buzzeins commented 5 years ago

thx