Setting up a Test FTP Server in Node

On a recent project, I had a need to create an FTP connection to a third-party server. Since we had no control over the server, I also wanted to setup a test FTP server that I could use to run our client against to make sure we could connect successfully. It turned out that implementing an FTP client and server in Node required a bit of work. We eventually solved this by using two libraries from NPM – jsftp for the client, and ftp-srv for the test server.

Read more on Setting up a Test FTP Server in Node…

Using an Int Type in TypeScript

The project I’m working on has a Node.js back end written in TypeScript, with a PostgreSQL database for persistence. We had a production user who encountered an error when the system tried to insert a row into a table that had an integer column in it. The value it was trying to insert was 239.99999999999997, so it made sense that PostgreSQL was complaining about it being “invalid input syntax for an integer.”

Read more on Using an Int Type in TypeScript…

“Understanding TypeScript’s Structural Type System” at Strange Loop 2018

I'm super excited to be giving a talk about TypeScript at Strange Loop this year! The talk, “Understanding TypeScript's Structural Type System,” covers some of the deeper and most exciting ideas at the heart of TypeScript's namesake feature.

Read more on “Understanding TypeScript’s Structural Type System” at Strange Loop 2018…

Creating a Drag-and-Drop File Uploader with React & TypeScript

A while ago, I was working on a project based off the Atomic SPA Starter Kit, which uses TypeScript, React, and GraphQL. One of the features we needed to build was a file upload component that supported dragging and dropping a file from a separate window onto the UI. Read more on Creating a Drag-and-Drop File Uploader with React & TypeScript…

Styling Custom Components in React Native Using TypeScript

I recently ran into an issue with providing style properties to custom React Native components written in TypeScript. When defining the type of the style property, we were using the ViewStyle and TextStyle types provided by React Native.

Read more on Styling Custom Components in React Native Using TypeScript…

Type-Safe Object Merging (TypeScript 2.8 Edition)

There are times when you want to merge two generic types in TypeScript, and type inference just isn’t doing it for you. Object.assign’s typing isn’t as precise as it could be, and spreading generics still doesn’t work. I’ve found a way to implement typing when merging objects using some of the new features in TypeScript 2.8.

Read more on Type-Safe Object Merging (TypeScript 2.8 Edition)…