{"_id":"grunt-jstools","_rev":"30-ffbbf49ba5baf47919f9775f1c65a87d","name":"grunt-jstools","time":{"modified":"2022-06-18T15:21:41.728Z","created":"2013-01-18T09:28:10.595Z","0.0.1":"2013-01-18T09:28:13.585Z","0.0.2":"2013-01-18T09:41:05.890Z","0.0.3":"2013-01-18T09:42:16.618Z","0.0.4":"2013-01-21T02:09:29.650Z","0.0.5":"2013-01-24T05:02:17.539Z","0.0.6":"2013-01-24T05:02:46.041Z","1.0.0":"2013-01-24T08:29:11.914Z","1.0.1":"2013-01-25T09:46:26.713Z","1.1.0":"2013-11-20T07:53:14.279Z","1.1.1":"2013-11-20T08:33:35.852Z","1.1.2":"2015-12-10T05:44:05.267Z","1.1.3":"2015-12-10T05:52:54.550Z"},"maintainers":[{"name":"sculove","email":"sculove@gmail.com"}],"dist-tags":{"latest":"1.1.3"},"description":"support javascript merge, each compress, all in compress, each beautify, all in beautify, each obfuscation, all in obfuscation, etc...","readme":"# grunt-jstools\njavascript 배포에 필요한 작업을 하는 grunt 플러그인\n\n- javascript 파일을 하나의 파일로 합치거나 각각의 파일을 대상 폴더에 복사한다\n- 합쳐지거나 복사된 파일을 최적화 level에 따라 주석 제거(nocomment), 최소화(min), 코드 난독화(default) 작업을 진행한다.\n\n\n## About\n이 태스트(task)는 [multi task]이다. grunt는 자동적으로 'jstools' 타겟 아래의 작업들을 순환하며 실행한다.\n\n\n## Install\n1. [nodejs]와 [grunt-cli]를 설치한다.\n2. 프로젝트 [grunt 프로젝트 생성 가이드][getting-started]에 따라 Gruntfile.js 파일과 package.json 파일을 생성하고, grunt-jstools를 npm을 통해 설치한다. (--save-dev 옵션을 주면 자동으로 package.json파일에 devDependency가 추가된다)\n```\nnpm install grunt-jstools --save-dev\n```\n3. grunt.js 파일에 다음과 같은 코드를 통해 grunt-jstools를 타스크를 로딩한다.\n\n[nodejs]: http://nodejs.org/\n[grunt-cli]: http://gruntjs.com/getting-started#installing-the-cli\n[getting-started]: http://gruntjs.com/getting-started#preparing-a-new-grunt-project\n\n\n## Project configuration\n다음은 grunt-jstools 플러그인을 사용하기 위해, grunt.js에 'jstools' 타스크(task)에 'dist'를 추가하고, grunt-jstools를 로딩한 예이다.\n\n```javascript\n// grunt.js 설정 파일\ngrunt.initConfig({\n  // Lists of files to be concatenated.\n  jstools: {\n  \t작업종류 : {\n  \t\t// 작업대상이 될 javascript 파일 패턴\n\t\tsrc: [],\n\t\t// 결과물이 될 파일이나, 디렉토리\n\t\tdest: '',\n\t\t// 작업대상의 주석을 제거하거나, 축소하거나, 코드 난독화 종류를 지정\n\t\tlevel: \"\"\n  \t}\n  }\n});\n\n// grunt-jstools 플러그인을 로딩한다. \ngrunt.loadNpmTasks('grunt-jstools');\n```\n\n- `src` -- 대상이 되는 javascript 파일 패턴 (필수값)\n- `dest` -- 주석제거, 최소화, 코드 암복호화가 적용될 대상. 디렉토리일 경우, `src` 패턴에 해당되는 파일들이 디렉토리에 생성된다. 파일일 경우, `src` 패턴에 해당되는 파일들이 하나로 합쳐진다. (필수값)\n- `level` -- 생략할 경우, 코드 난독화가 적용되고, `nocomment`일 경우, 주석만 제거되고, `min`일 경우, 주석이 제거되고, 코드가 최소화된다.\n\n\n## Usage examples\n\n### 다수의 소스(디렉토리, 파일)을 하나의 파일로 만드는 예\n`grunt jstools:type1`를 호출하면 'src'에 입력한 패턴에 해당하는 파일을 'merge_min.js' 파일 하나로, 코드 난독화하여 생성된다.\n```javascript\n// Project configuration.\ngrunt.initConfig({\n  jstools: {\n    type1: {\n\t\tsrc : [ \"source/**/*.js\", \"jindo.js\" ],\n\t\tdest : \"merge_min.js\"\n    }\n  }\n});\n\ngrunt.loadNpmTasks('grunt-jstools');\n```\n\n### 다수의 소스(디렉토리, 파일)을 하나의 디렉토리에 각각 복사하는 예\n`grunt jstools:type2`를 호출하면 'src'에 입력한 패턴에 해당하는 파일을 'output' 디렉토리 하위에 src에 입력한 파일들이 각각 주석이 제거(nocomment)된 상태로 생성된다.\n```javascript\n// Project configuration.\ngrunt.initConfig({\n  jstools: {\n    type2: {\n\t\tsrc : [ \"source/**/*.js\", \"jindo.js\" ],\n\t\tdest : \"output\",\n\t\tlevel : \"nocomment\"\n    }\n  }\n});\n\ngrunt.loadNpmTasks('grunt-jstools');\n```\n\n### Multiple build targets\n'grunt jstools'를 호출하면 \ntype1이 호출되어, type1의 'src'에 입력한 패턴에 해당하는 파일을 'merge_min.js' 파일 하나로, 최소화(min)하여 생성되고,\ntype2가 호출되어, type2의 'src'에 입력한 패턴에 해당하는 파일을 'output' 디렉토리 하위에 src에 입력한 파일들이 각각 코드 난독화된 상태로 생성된다.\n\n```javascript\n// Project configuration.\ngrunt.initConfig({\n\tjstools : {\n\t\ttype1: {\n\t\t\tsrc : [ \"source/**/*.js\", \"jindo.js\" ],\n\t\t\tdest : \"merge_min.js\",\n\t\t\tlevel : \"min\"\n\t\t}\n\t\ttype2: {\n\t\t\tsrc : [ \"source/**/*.js\", \"jindo.js\" ],\n\t\t\tdest : \"output\"\n\t\t}\n\t}\n});\n\ngrunt.loadNpmTasks('grunt-jstools');\n```\n\n\n## Release History\n- v1.1.3 remove unnecessary files (2015. 12. 10)\n- v1.1.2 change License from LGPL v2 to MIT (2015. 12. 10)\n- v1.1.1 add dependency library (2013. 11. 20)\n- v1.1.0 dest 속성에 해당하는 디렉토리가 있을 경우 오류 수정 (2013. 11. 20)\n- v1.1.0 dest 속성 필수로 변경 (2013. 11. 17)\n- v1.1.0 grunt 4.0 base로 변경 (2013. 11. 17)\n- v1.0.1 압축률 및 gzip 했을 경우의 변화량을 알려줌 (2013. 1. 25)\n- v1.0.0 Release (2013. 1. 24)\n\n## Refrenece site\n- http://gruntjs.com/getting-started  \n- http://gruntjs.com/api/grunt  \n- https://github.com/mishoo/UglifyJS2  \n- http://lisperator.net/uglifyjs/  \n- http://blog.outsider.ne.kr/829  \n\n## **Issues**\nIf you find a bug, please report us via the GitHub issues page.  \nhttps://github.com/sculove/grunt-jstools/issues\n\n## License\nLicensed under MIT:  \nhttps://www.gnu.org/licenses/old-licenses/lgpl-2.0.html  \n\n[![Analytics](https://ga-beacon.appspot.com/UA-37362821-5/grunt-jstools/readme)](https://github.com/sculove/grunt-jstools)","versions":{"1.1.3":{"name":"grunt-jstools","description":"support javascript merge, each compress, all in compress, each beautify, all in beautify, each obfuscation, all in obfuscation, etc...","version":"1.1.3","homepage":"https://github.com/sculove/grunt-jstools","author":{"name":"sculove","email":"sculove@gmail.com","url":"http://sculove.pe.kr"},"repository":{"type":"git","url":"https://github.com/sculove/grunt-jstools.git"},"bugs":{"url":"https://github.com/sculove/grunt-jstools/issues"},"license":"MIT","main":"Gruntfile.js","bin":{"grunt-jstools":"bin/grunt-jstools"},"engines":{"node":"*"},"dependencies":{"uglify-js":"*","gzip-js":"*","grunt":"~0.4.1"},"keywords":["gruntplugin","javascript","js","tools","beautify","obfuscation","compress"],"gitHead":"efe079eb55db7c5b4d2e8f0ab62821ea4c94275c","_id":"grunt-jstools@1.1.3","scripts":{},"_shasum":"0f7d636d5c7a2912f3ca07e2ea6e921bc8883dfa","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"sculove","email":"sculove@gmail.com"},"maintainers":[{"name":"sculove","email":"sculove@gmail.com"}],"dist":{"shasum":"0f7d636d5c7a2912f3ca07e2ea6e921bc8883dfa","tarball":"https://registry.npmjs.org/grunt-jstools/-/grunt-jstools-1.1.3.tgz","integrity":"sha512-b1ztUg45AvNh+q72l888uGCVMAIEhgQuSchYrGzNQ1ebhEYfeh/V8qXjnp4lxgzROvkYg1Z7cyRD/Gz++M5hfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC68/FAGBx61ZmIykAG2yCh+dxCajeaAJqFEDli2ziUVgIhAIDdJYXfrYHHz6y+v+V4T02LSFOot91L5XlgRi2S7KW1"}]}}},"homepage":"https://github.com/sculove/grunt-jstools","keywords":["gruntplugin","javascript","js","tools","beautify","obfuscation","compress"],"repository":{"type":"git","url":"https://github.com/sculove/grunt-jstools.git"},"author":{"name":"sculove","email":"sculove@gmail.com","url":"http://sculove.pe.kr"},"bugs":{"url":"https://github.com/sculove/grunt-jstools/issues"},"license":"MIT","readmeFilename":"README.md"}