Sinonjs – Standalone test fakes, mocks, stubs for JavaScript

SinonJS provides stand alone test spies, stubs and mocks. This is the mechanism we’ll be using to create our spies, stubs and mocks. Spies: Creates fake functions which we can use to track executions. This means we can tell/ find out whether the function has been executed/ how many times its been called etc. We can also …

image-downloader

image-downloader is a npm package which dowloads images using it’s url. There are several libraries which performs such functionality, but this library has it’s advantage. Some sites serve their images using backend script. For example, image url is composed as following http://somesite.com/image.php?name=dummy In this case, many libraries are not able to download the image but …

What is AMD, CommonJS, and UMD?

Over the years there’s been a steadily increasing ecosystem of JavaScript components to choose from. The sheer amount of choices is fantastic, but this also infamously presents a difficulty when components are mixed-and-matched. And it doesn’t take too long for budding developers to find out that not all components are built to play nicely together. …

Graphile, Postgrephile – powerful PostgreSQL based GraphQL backend development.

PostGraphile (formerly PostGraphQL) builds a powerful, extensible and performant GraphQL API from a PostgreSQL schema in seconds; saving you weeks if not months of development time. PostGraphile is formed of three layers. At the very top is the PostGraphile CLI. This layer is the most user-friendly and is responsible for three things: accepting common options from …

Build a Serverless Web Application with AWS Lambda, Amazon API Gateway, Amazon S3, Amazon DynamoDB, Amazon Cognito and Amazon SQS

Amazon provides very powerful and easy to use services and infrastructure for developing micro services based web application. There is no need to use other services or worry about scaling and deployment issues. Please check this official documentation for details. https://aws.amazon.com/getting-started/projects/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/

Multer S3 – Streaming multer storage engine for AWS S3.

This project is mostly an integration piece for existing code samples from Multer’s storage engine documentation with s3fs as the substitution piece for file system. Existing solutions I found required buffering the multipart uploads into the actual filesystem which is difficult to scale. Installation npm install –save multer-s3 Usage The optional cacheControl option sets the Cache-Control HTTP header that will be sent if you’re serving the …

Managing node.js project with multiple packages using lerna.js

Lerna is a tool that optimizes the workflow around managing multi-package repositories with git and npm. Splitting up large codebases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast. To solve these (and many other) …