Programming/node.js2019. 5. 27. 12:28

pdf 읽어오고 변환하는건 python이나 node.js 그리고 java 등에 모두 존재는 하는 듯

그래도 라이센스가 문제인데..

 

[링크 : https://pdfbox.apache.org/]

[링크 : https://www.tutorialkart.com/pdfbox/extract-text-line-by-line-from-pdf/]

 

[링크 : https://itextpdf.com/en]

[링크 : https://stackoverflow.com/questions/4028240/extract-columns-of-text-from-a-pdf-file-using-itext]

 

[링크 : https://www.npmjs.com/package/pdfreader]

[링크 : https://www.npmjs.com/package/pdf-lib]

 

[링크 : http://www.unixuser.org/~euske/python/pdfminer/]

PDFMiner 모듈은 Python 2 버젼에서만 사용 가능

[링크 : https://dgkim5360.tistory.com/entry/python-pdfminer-convert-pdf-to-html-txt]

'Programming > node.js' 카테고리의 다른 글

electron.js  (0) 2019.06.03
npm-run-all 병렬 빌드 (실패)  (0) 2019.05.29
node.js express 301 redirect  (0) 2019.05.15
node.js 항목 확인  (0) 2019.04.23
proxy error: Error: write after end  (0) 2019.04.23
Posted by 구차니
Programming/node.js2019. 5. 15. 13:38

흐음.. 캐싱할때 이걸 어떻게 상태로 캐싱을 해놓으면 되려나..

 

app.use(function forceLiveDomain(req, res, next) {
  // Don't allow user to hit Heroku now that we have a domain
  var host = req.get('Host');
  if (host === 'serviceworker-cookbook.herokuapp.com') {
    return res.redirect(301, 'https://serviceworke.rs/' + req.originalUrl);
  }
  return next();
});

 

[링크 : https://davidwalsh.name/express-redirect-301]

[링크 : https://stackoverflow.com/questions/7450940/automatic-https-connection-redirect-with-node-js-express]

 

res.redirect([status,] path)
Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code . If not specified, status defaults to “302 “Found”.

[링크 : https://expressjs.com/ko/4x/api.html#res.redirect]

'Programming > node.js' 카테고리의 다른 글

npm-run-all 병렬 빌드 (실패)  (0) 2019.05.29
pdf 내용 추출  (0) 2019.05.27
node.js 항목 확인  (0) 2019.04.23
proxy error: Error: write after end  (0) 2019.04.23
node.js 시그널 핸들링과 reload  (0) 2019.04.23
Posted by 구차니
Programming/node.js2019. 4. 23. 18:17

와.. 'undefined' 랑 비교 안해도 되는 저런 멋진 문법?

if('content-length' in ctx.proxyToServerRequestOptions.headers)

[링크 : https://github.com/.../examples/removeProxyToServerContentLength.js]

[링크 : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in]

'Programming > node.js' 카테고리의 다른 글

pdf 내용 추출  (0) 2019.05.27
node.js express 301 redirect  (0) 2019.05.15
proxy error: Error: write after end  (0) 2019.04.23
node.js 시그널 핸들링과 reload  (0) 2019.04.23
nodejs url param delete  (0) 2019.04.17
Posted by 구차니
Programming/node.js2019. 4. 23. 18:07

흐음.. 왜 안써지냐..

기본 예제로는 response.end(data) 식이었고..

얘는 response.write(data, endcoding); response.end(callback); 두개 문장으로 실행되는 유사한 효과를 준다는데

그럼 되는거 아닌가? ㅠㅠ

 

response.end([data][, encoding][, callback])#

History

This method signals to the server that all of the response headers and body have been sent; that server should consider this message complete. The method, response.end(), MUST be called on each response.

If data is specified, it is similar in effect to calling response.write(data, encoding) followed by response.end(callback).

If callback is specified, it will be called when the response stream is finished.

[링크 : https://nodejs.org/api/http.html#http_class_http_serverresponse]

 

 

+

으으 망할.. async 문제인가?

[링크 : https://teamtreehouse.com/community/error-write-after-end-3]

'Programming > node.js' 카테고리의 다른 글

node.js express 301 redirect  (0) 2019.05.15
node.js 항목 확인  (0) 2019.04.23
node.js 시그널 핸들링과 reload  (0) 2019.04.23
nodejs url param delete  (0) 2019.04.17
url 끝의 /  (0) 2019.04.17
Posted by 구차니
Programming/node.js2019. 4. 23. 13:31

process.on 으로 시그널 핸들러를 연결해두는 듯

 

var cluster = require('cluster');

console.log('started master with ' + process.pid);

//fork the first process
cluster.fork();

process.on('SIGHUP', function () {
  console.log('Reloading...');
  var new_worker = cluster.fork();
  new_worker.once('listening', function () {
    //stop all other workers
    for(var id in cluster.workers) {
      if (id === new_worker.id.toString()) continue;
      cluster.workers[id].kill('SIGTERM');
    }
  });
});

[링크 : https://joseoncode.com/2015/01/18/reloading-node-with-no-downtime/]

[링크 : http://zguide.zeromq.org/js:interrupt]

[링크 : https://stackoverflow.com/questions/20165605/detecting-ctrlc-in-node-js]

'Programming > node.js' 카테고리의 다른 글

node.js 항목 확인  (0) 2019.04.23
proxy error: Error: write after end  (0) 2019.04.23
nodejs url param delete  (0) 2019.04.17
url 끝의 /  (0) 2019.04.17
js array key 삭제하기  (0) 2019.04.16
Posted by 구차니
Programming/node.js2019. 4. 17. 22:06

url 파라미트에서 특정 녀석을 삭제할 수 있는 기능

 

urlSearchParams.delete(name)#

Remove all name-value pairs whose name is name.

[링크 : https://nodejs.org/api/url.html#url_urlsearchparams_delete_name]

Posted by 구차니
Programming/node.js2019. 4. 17. 18:27

간단하게 말하면 / 가 붙으면 directory

없으면 file로 간주하고 그에 따라 행동이 달라진다는 내용

[링크 : https://djkeh.github.io/articles/Why-do-we-put-slash-at-the-end-of-URL-kor/]

 

근데.. 클라이언트나 서버에서 임의로 /를 붙여서 해석하다 보니

어떤곳에서는 /가 붙고 어떤것에서는 /가 안 붙는데

요즘에는 RESTful API에 의해서

/는 단순 구분자가 되었고

/api/stone/

/api/stone/apply

식으로 꼬리에 꼬리를 물게 구성가능하다 보니

기존의 디렉토리, 파일 구조로 캐싱하기 쉽지가 않다..

 

+

node.js 에서 끝에 /로 끝나는 것 찾기

[링크 : https://stackoverflow.com/questions/6165381/how-to-get-the-last-part-of-a-string-in-javascript/6165387]

Posted by 구차니
Programming/node.js2019. 4. 16. 18:21

'Programming > node.js' 카테고리의 다른 글

nodejs url param delete  (0) 2019.04.17
url 끝의 /  (0) 2019.04.17
크롬에서 "사용가능한 소켓 대기중" 상태표시줄 메시지  (0) 2019.04.16
proxy error: Error: write after end  (0) 2019.04.15
https cache proxy using node.js  (0) 2019.04.12
Posted by 구차니
Programming/node.js2019. 4. 16. 12:41

프록시 갈군다고 크롬으로 하다 보니.. 아래에서 자꾸 먼가 뜨는데

찾아보니.. 지금도 그런진 모르겠지만 크롬은 소켓 6개까지 열수 있다고

그래서 ajax 등으로 소켓이 닫히지 않으면 이런식으로 대기가 걸리는 고질적인 문제가 있다고 한다.

프록시에서 그럼 응답을 못 받으면 헤어나질 못하게 되는건가?

 

[링크 : https://dev18.tistory.com/35]

[링크 : https://dev.uhoon.co.kr/entry/waiting-for-available-sockets-사용-가능한-소켓-대기-중-에러-원인과-확인]

 

+

아래 링크로 가면 관리 페이지가 뜨긴 하는데 상세 소켓별 상태를 볼 수 있는건 아님

[링크 : chrome://net-internals/#sockets]

'Programming > node.js' 카테고리의 다른 글

url 끝의 /  (0) 2019.04.17
js array key 삭제하기  (0) 2019.04.16
proxy error: Error: write after end  (0) 2019.04.15
https cache proxy using node.js  (0) 2019.04.12
node.js mkdir -p 옵션 사용하기  (0) 2019.04.10
Posted by 구차니
Programming/node.js2019. 4. 15. 18:20

에러는 뜨는데 어떻게 해결해야 할지 감이 안오네..

 

[링크 : https://stackoverflow.com/questions/27769842/write-after-end-error-in-node-js-webserver]

Posted by 구차니