{"id":13447187,"url":"https://github.com/liriliri/eustia","last_synced_at":"2025-04-05T16:09:10.909Z","repository":{"id":1756236,"uuid":"42349407","full_name":"liriliri/eustia","owner":"liriliri","description":"Tool for generating utility libraries","archived":false,"fork":false,"pushed_at":"2022-05-27T18:25:42.000Z","size":1017,"stargazers_count":287,"open_issues_count":0,"forks_count":26,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-02T20:02:00.950Z","etag":null,"topics":["bundler","utility"],"latest_commit_sha":null,"homepage":"https://eustia.liriliri.io/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liriliri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-12T07:55:46.000Z","updated_at":"2024-11-01T14:31:45.000Z","dependencies_parsed_at":"2022-08-20T11:40:49.699Z","dependency_job_id":null,"html_url":"https://github.com/liriliri/eustia","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liriliri%2Feustia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liriliri%2Feustia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liriliri%2Feustia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liriliri%2Feustia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liriliri","download_url":"https://codeload.github.com/liriliri/eustia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361691,"owners_count":20926643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundler","utility"],"created_at":"2024-07-31T05:01:10.438Z","updated_at":"2025-04-05T16:09:10.882Z","avatar_url":"https://github.com/liriliri.png","language":"TypeScript","funding_links":[],"categories":["JavaScript","TypeScript"],"sub_categories":[],"readme":"\u003ca href=\"https://eustia.liriliri.io/\" target=\"_blank\"\u003e\n    \u003cimg src=\"./doc/banner.jpg\"\u003e\n\u003c/a\u003e\n\n[中文](doc/README_CN.md)\n\n# Eustia\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![License][license-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/eustia?style=flat-square \n[npm-url]: https://npmjs.org/package/eustia\n[travis-image]: https://img.shields.io/travis/liriliri/eustia?style=flat-square\n[travis-url]: https://travis-ci.org/liriliri/eustia\n[codecov-image]: https://img.shields.io/codecov/c/github/liriliri/eustia?style=flat-square\n[codecov-url]: https://codecov.io/github/liriliri/eustia?branch=master\n[license-image]: https://img.shields.io/npm/l/eustia?style=flat-square\n\nEustia is a tool for generating JavaScript utility libraries. It scans your code \nto generate libraries containing only methods needed on the fly.\n\n![screen shot](https://eustia.liriliri.io/static/img/eustia-screenshot.gif)\n\n## Installation\n\nYou can install Eustia using Node Package Manager(**npm**).\n\n```bash\nnpm install -g eustia\n```\n\n## Quick Example\n\nSuppose you want to use trim function in index.html, just write the code down as \nfollows:\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"/\u003e\n    \u003ctitle\u003eEustia\u003c/title\u003e\n    \u003cscript src=\"util.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cscript\u003e\n    var projectName = _.trim(' Eustia ');\n    // Some code...\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nRun command:\n\n```bash\neustia build\n```\n\nThe tool will scan you html code and generate a file name **util.js**(Default \noutput file name). And that is it, everything is just done!\n\n## Use a Configuration File\n\nYou can use Eustia with command lines totally. It usually follows the same\npattern described below:\n\n```bash\neustia build -o util.js index.html *.js ...\u003clist of files to be scanned\u003e\n```\n\nIt's also possible to use a configuration file to save settings. This is pretty \nhelpful especially when you want to generate multiple utility libraries for \ndifferent sections of your website.\n\nJust create a file named **.eustia** in your project root.\n\n```json\n{\n    \"page\": {\n        \"files\": \"./layout/**/*.jade\",\n        \"output\": \"./static/js/eustia.js\"\n    },\n    \"node\": {\n        \"files\": [\"./lib/*.js\", \"./tool/**/*.js\"],\n        \"output\": \"./lib/util.js\"\n    }\n}\n```\n\nRunning Eustia without any sub commands, the tool will find **.eustia** under \ncurrent working directory to read configuration to generate libraries. It is \nalmost the same as running build command from console, just a different way of \npassing options.\n\nFor a full list of options can be used, please check\n[document](https://eustia.liriliri.io/docs.html#commands) page.\n\n## Prepare Modules\n\nMaterials must be prepared first to cook a good meal. Right now, our materials \nis a bunch of small modules. Eustia provides many \n[utilities](https://eustia.liriliri.io/module.html) itself(currently under \ndevelopment). Still, there are times you want to add your own ones. \nTo achieve that, create a directory named **eustia** in the root directory.\n\nNow, let's say I want to have a function to compare version numbers. The first \nstep is to create a js file named **compareVersion.js** in **eustia** directory. \nThen fills it with actual codes to finish the procedure.\n\n```javascript\n// eustia/compareVersion.js\n_('isStr each'); // dependencies\n\n// export object\nfunction exports(v1, v2)\n{\n    if (!isStr(v1) || !isStr(v2)) return;\n    ...\n}\n```\n\nNow you can use **compareVersion** anywhere in your project.\n\nUsing option **library** allows you to search functions in other paths, \nquite useful when sharing functions among several projects. Besides, \n**Lodash** functions is available by using \n[eustia-lodash](https://github.com/liriliri/eustia-lodash).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliriliri%2Feustia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliriliri%2Feustia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliriliri%2Feustia/lists"}