Directory Structure, Module Resolution and Related Configuration Options

Image for post
Image for post

Directory structures and module resolution of TypeScript projects are not complex, until you start organizing things into separate units, putting them into different directories, and experimenting with some of the configuration options discussed here.

This article provides an overall understanding of the mechanisms and configuration options that affect TypeScript project directory structures and module resolution, as well as some caveats in the hope of saving the reader from certain pitfalls. However, it is not a tutorial, and does not give detailed examples. …


So one day I was wondering if ‘any’ extends ‘object’.

I was amazed of what I had found out.

Image for post
Image for post

Gulp tasks make heavy use of node.js object Transform stream API (https://nodejs.org/api/stream.html#stream_class_stream_transform) to process files. More accurately, to process Vinyl (https://gulpjs.com/docs/en/api/vinyl) objects that represent files. There are gulp plugins that provide ready made node stream.Transform objects for performing many kinds of processing.

To write a gulp plugin is to implement a stream.Transform. Check “Implementing a Transform Stream” in the node.js stream API documentation (https://nodejs.org/api/stream.html#stream_implementing_a_transform_stream). The codes below is a gulp task that reads files under ./src/**.* and concatenates the contents to the corresponding files under ./dst, e.g. “./src/a.txt” concatenates to “./dst/a.txt”. Like most gulp tasks, it starts with gulp.src() …

About

Bing Ren

Developer, paddler

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store