---
title: "Discussion on \"Two common ways to destruct modules in Node.js\" | Hashnode"
description: "Discussion on \"Two common ways to destruct modules in Node.js\". Destructuring in CJS\nconst {stdin: input, stdout: output} = require('process');\n\n// Example exploiting Readline\nconst rl_cjs = readline.createInterface({\n    input: process.stdin,\n    output: process."
url: "https://hashnode.com/posts/destructuring-in-node/61a7a9d14b0b9223386b978f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Two common ways to destruct modules in Node.js](https://vanillacamp.hashnode.dev/destructuring-in-node?utm_source=hashnode&utm_medium=feed)

Destructuring in CJS const {stdin: input, stdout: output} = require('process'); // Example exploiting Readline const rl\_cjs = readline.createInterface({ input: process.stdin, output: process.

Dec 1, 2021 · 1 min read · vanillacamp.hashnode.dev  
Updated Aug 22  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#modules](https://hashnode.com/tag/modules)
-   [#javascript-modules](https://hashnode.com/tag/javascript-modules)
-   [#es6](https://hashnode.com/tag/es6)

## Written by

[Lukas Gaučas](https://hashnode.com/@projektorius96)

@projektorius96 · Worldwide

  
[View profile](https://hashnode.com/@projektorius96)

Turtle is always a winner

Digital nomad

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
