3 ms·
Just to be clear your “library” is literally one line of code: console.log(JSON.stringify(rows, null, 2)); So what’s the point?
by byteshock 7y ago
Just to be clear your “library” is literally one line of code:
console.log(JSON.stringify(rows, null, 2));
So what’s the point?
- soheilpro 7y agoYes, it's essentially one line of code but it makes my daily routine of running queries against Postgres and then processing the results with other tools much easier.
- goatinaboat 7y agoI would be willing to bet that you can do everything you need to entirely with in Postgres/psql/PGPLSQL.
- techntoke 7y agoWelcome to Node
- thunderbong 7y agoI guess the reason this is getting downvoted is because there isn't sufficient information in the comment. It's true, however. I find this is rampant in the Node community - For any small feature, rather than making a PR or suggesting changes to the original module (maybe via an option), the goal is to create a new library. I feel what the Node community doesn't realize is that this creates a dependency hell where I can't run my programs which were running a week back, by pulling in the latest libraries. Another example I came across recently was redux-thunk[0], which is used practically wherever redux is used. All it does is add a callback! This is entire code of redux-thunk library! function createThunkMiddleware(extraArgument) { return ({ dispatch, getState }) => next => action => { if (typeof action === 'function') { return action(dispatch, getState, extraArgument); } return next(action); }; } const thunk = createThunkMiddleware(); thunk.withExtraArgument = createThunkMiddleware; export default thunk; [0]: https://github.com/reduxjs/redux-thunk https://github.com/reduxjs/redux-thunk
- goatinaboat 7y agofeel what the Node community doesn't realize is that this creates a dependency hell You misunderstand the dynamic here. In the Node community you get bragging rights for how many “libraries” you have written and how many times they have been downloaded (99.99% of which will be by automated build systems, usually without the end user even being aware of any individual libraries except at the top level). These entangled dependencies are the entire point.
- johnisgood 7y agoYeah, tempted to post all my scripts (in various languages) here which are over 100 LOC on average. There are hundreds.