LoginSignup
2
0

More than 5 years have passed since last update.

nodejsのpm2、linuxの環境変数が反映されるタイミングは?

Posted at

以下の環境。
plaintext
[ec2-user@ip-172-31-26-74 ~]$ pm2 --version
2.10.3
[ec2-user@ip-172-31-26-74 ~]$ node --version
v10.1.0

pm2 restart 0 --update-env & pm2 saveでおk。

もっと複雑な条件だと思ってたのでオチはないです

メモ。jsonのオブジェクトをキーでソートしてNormalizeする処理


k=JSON.stringify(JSON.parse(v),(key,val)=>{
  if( typeof val == "object" && val != null && Array.isArray(val) == false){
    const keys = Object.keys(val);
    if(keys==null){debugger;}
    const keysSort = keys.sort();
    const r = {};
    for(let v of keysSort){
      r[v] = val[v];
    }
    return r;
  }else{
    return val;
  }
},"  ");copy(k);

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0