I have this nagging problem of determining an end user’s country/region in my web apps. The reasons for doing that are many - Automatic conversion of an event date/time Display regional news Show prices in user’s currency .. and so on We could do two things to determine a user’s region -
We have looked at functions quite a bit on this blog over the last two years. We have seen many avatars of a function including a function object, a function’s method, function of functions, and so on. But, what we have not done is to document all the ways in which we can define functions.
Here’s a quick demo of how you can convert XML to JSON in NodeJS. Problem You are given a slew of XML files and you have to convert them to JSON. But why JSON? It takes lesser space Faster and easier to work with What are we dealing with here?
I have used AdonisJS in and out of projects in the last year. Despite it’s smaller community and not-so-regular enhancements, it remains one of my favourite NodeJS frameworks. I recommend AdonisJS for hobby and production projects in full confidence :) I typically use AdonisJS for back-end, which has me start with -
Fastode is an experimental boilerplate / framework based on Fastify. Why another boilerplate? Well, I just wanted to experiment with technologies to create MVP products. Although I have used NestJS, AdonisJS and friends before, those frameworks, while being great, bring their structure and overhead to any project. I wanted to check how difficult or easy it is to just start with a bunch of basic features and leave everything else to the project.
How can you use packages being developed locally in other projects - without publishing them to npm repository? NPM Packages Make Life Exciting NPM makes it really easy to create packages and reuse them across projects. I am not even talking about big, useful libraries like Vue, Loadash etc. - just the routine problems across our projects.
I had been meaning to use more of Fastify for work, but only made that a reality recently. So far I have had a great experience on the server framework. What is Fastify? Fastify is a low-overhead server framework built on top of NodeJS. Fastify was started in late 2016 and jumped to v1.
I was getting back to Svelte for a small project and ran into a strange issue. npm run dev did not run the svelte app as expected - no output or errors. First I create a new project. 1 2 3 4 npx degit sveltejs/template awesome-project-1 cd awesome-project-1 npm i npm run dev And, I get greeted with nothing.
Why use unknown when we have any in Typescript? Type inferences are powerful and allows us to do magic when we don’t know types. 1 2 3 const i: any = 1; console.log(i); // 1 unknown seems to do the same thing. 1 2 let x: unknown = 1; console.