Coder Social home page Coder Social logo

node-argv's Introduction

node process小練習

背景知識

  1. node的api的東西,只能在node裡有用,在browser裡不能用。
  2. process
    1. node api提供一個object,是global,可以用來控制和了解目前的Node.js的process。
    2. process.argv
      1. 唸作arg-v
      2. 是一個array
      3. 第一個item是node這個程式所在的路徑,例如/usr/local/bin/node
      4. 第二個item是執行的js檔所在的路徑
      5. 第三個item是執行這個js檔後面放的參數,如此就可以執行時給這個程式一個參數了。

app用法

  1. 在terminal裡下node remote.js 一代,會得到唉,Apple TV 4K 一代的遙控器真得很難用
  2. 在terminal裡下node remote.js 二代,會得到幸運喔,Apple TV 4K 二代的遙控器好用多了
  3. 觀察參數一代二代如何傳進原始碼裡。

node-argv's People

Contributors

yellowful avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.