List all public packages in the npm registry

http://blog.npmjs.org/post/157615772423/deprecating-the-all-registry-endpoint describes the deprecation of the http://registry.npmjs.org/-/all endpoint, and links to the tutorial at https://github.com/npm/registry/blob/master/docs/follower.md as an alternative approach. That tutorial describes how to set up a “follower” that receives all changes made to the NPM registry. That’s… a bit odd, honestly. Clearly such a follower is not an adequate substitute for getting a list … Read more

Best practice for nodejs deployment – Directly moving node_modules to server or run npm install command

Running npm install in production server cannot be done in certain scenario (lack of compiling tools, restricted internet access, etc…) and also if you have to deploy the same project on multiple machines, can be a waste of cpu, memory and bandwidth. You should run npm install –production on a machine with the same libraries … Read more

Webpack doesn’t resolve properly my alias

Resolving the alias to the absolute path should do the trick: resolve: { alias: { myApp: path.resolve(__dirname, ‘src’), }, extensions: [”, ‘.js’, ‘.jsx’] } Check this webpack resolve alias gist with a simple example. Another solution to limit the number of relative paths is to add your ./src folder as root instead of aliasing it: … Read more

Windows Integrated Authentication in node.js Client

2015 Update: There are now some modules that implement Windows-integrated authentication. node-sspi uses SSPI (the Windows security API) to handle the server side of things, but does not do client auth. There are several client implementations such as http-ntlm, but they are not truly integrated since they require the user password — they do not … Read more

How to make create-react-app auto build?

Unfortunately this is something you will have to do yourself. You can use a tool like npm-watch to accomplish what you want though: Install npm-watch npm i –save-dev npm-watch package.json { “name”: “react-app”, “version”: “0.1.0”, “private”: false, “devDependencies”: { “npm-watch”: “^0.1.8”, “react-scripts”: “0.9.5”, }, “dependencies”: { “react”: “^15.4.2”, “react-dom”: “^15.4.2” }, “scripts”: { “start”: “react-scripts … Read more

Debugging jasmine-node tests with node-inspector

In short, just debug jasmine-node: node –debug-brk node_modules/jasmine-node/lib/jasmine-node/cli.js spec/my_spec.js If you look at the source of the jasmine-node script, it just invokes cli.js, and I found I could debug that script just fine. I wanted to use node-inspector to debug a CoffeeScript test. Just adding the –coffee switch worked nicely, e.g. node –debug-brk node_modules/jasmine-node/lib/jasmine-node/cli.js –coffee … Read more

How to get UTF-8 in Node.js?

Hook into you response generator or create a middleware that does the following: res.setHeader(“Content-Type”, “application/json; charset=utf-8”); Otherwise the browser displays the content in it’s favorite encoding. If this doesn’t help you DB is probably in the wrong encoding. For older node.js versions use: res.header(“Content-Type”, “application/json; charset=utf-8”);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)