44 Matching Annotations
  1. Jun 2022
  2. May 2022
    1. I develop in Node and Sveltekit regularly and the chances that on any given day my flow might be crushed by random madness is unacceptably high.
    1. Not only this. Try to change the app two years later. Dependencies gone, wrong NPM version, Webpack config depricated and what not.That's why I like to use vanilla JS as much as possible. It will be maintainable years later.
    1. To address this issue, and to make it easier for non-web browser environments to implement fetch in a consistent way, WinterCG is working on documenting a subset of the fetch standard that deals specifically with those different requirements and constraints.
  3. Jan 2022
  4. Dec 2021
    1. npm init -y \
      && npm i --save-dev node@16 \
      && npm config set prefix=$(pwd)/node_modules/node \
      && export PATH=$(pwd)/node_modules/node/bin:$PATH
  5. Nov 2021
    1. import { createRequire } from "module"; const require = createRequire(import.meta.url); const data = require("./data.json");
  6. Oct 2021
  7. Jan 2021
    1. Buffers and TypedArrays

      Mozilla TypedArray document

      Uint8Array is a type of TypedArray

      and Buffer is an instance of Uint8Array

      Creating TypedArrays from Buffer with or without sharing same memory.

      Creating a Buffer from the TypedArrays with or without sharing the same memory

      In order to share memory we use

      1. Buffer.buffer, Buffer.byteOffset, Buffer.length / TypedArray.BYTES_PER_ELEMENT
      2. TypedArray.buffer, offset, length
  8. Apr 2020
  9. Dec 2019
    1. You have to create duplicate of the stream by piping it to two streams. You can create a simple stream with a PassThrough stream, it simply passes the input to the output.
  10. Sep 2019
  11. Jun 2019
  12. Apr 2019
  13. Nov 2018
  14. Oct 2018
  15. Sep 2018
    1. module.exports属性表示当前模块对外输出的接口,其他文件加载该模块,实际上就是读取module.exports变量。


      1. require 获得的是 module.export 对象;
      2. export === modue.export 指向同一块内存;export 是一个快捷方式,覆盖就没有意义;
      3. module.export 可以覆盖,这取决与需要暴露什么对象或方法;覆盖后 export 无效,因为 第 1 条;
  16. Jun 2018
    1. The next set of functions call app.use() to add the middleware libraries into the request handling chain

      This is how you'd add middlewares!

    2. Then we require() modules from our routes directory

      Routes are also a module. This 'module' is nothing more than a way to 'include' other file, so to speak in PHP terms. Its the ability to split code/functionality across multiple manageable files

  17. Apr 2018
  18. Nov 2017
  19. Jan 2016
  20. Jun 2015
    1. stream-adventure

      Some overlap with learnyounode and fewer instructions, I think this is one of the first ones that was created. Still nice to really dig into streams which are an important concept to understand.

    2. learnyounode

      This one's really well done, I recommend starting here if you already have some JS experience.

    3. Right now there's no good way (that I know of) to keep track of new workshoppers (the little interactive workshops that you can run on your own), so I occasionally check https://github.com/nodeschool/nodeschool.github.io (the code of the website) for commits.

  21. May 2015
  22. Jan 2014
    1. What are the some of the challenges that we are going to face in the next 5 years?

      Interesting analysis of Node.js's possible strengths.