{"id":13548027,"url":"https://github.com/awoojs/awoo","last_synced_at":"2025-08-16T19:31:11.128Z","repository":{"id":57125291,"uuid":"83988815","full_name":"awoojs/awoo","owner":"awoojs","description":":small_orange_diamond: declarative small site generator","archived":false,"fork":false,"pushed_at":"2020-05-16T09:52:04.000Z","size":806,"stargazers_count":91,"open_issues_count":12,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-13T01:35:48.843Z","etag":null,"topics":["awoo","javascript","middleware","nodejs","static-site-generator"],"latest_commit_sha":null,"homepage":"http://npm.im/awoo","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awoojs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-05T17:31:00.000Z","updated_at":"2024-09-25T23:30:08.000Z","dependencies_parsed_at":"2022-09-04T11:00:27.084Z","dependency_job_id":null,"html_url":"https://github.com/awoojs/awoo","commit_stats":null,"previous_names":["wehjs/weh"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awoojs%2Fawoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awoojs%2Fawoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awoojs%2Fawoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awoojs%2Fawoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awoojs","download_url":"https://codeload.github.com/awoojs/awoo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230051294,"owners_count":18165199,"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":["awoo","javascript","middleware","nodejs","static-site-generator"],"created_at":"2024-08-01T12:01:04.736Z","updated_at":"2024-12-17T02:17:54.080Z","avatar_url":"https://github.com/awoojs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","nodejs"],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003e\n  \u003cb\u003eCurrently not maintained! If you would like to resume maintenance, please open an issue!\u003c/b\u003e\n\u003c/h3\u003e\n\n\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"logo.gif\" width=\"150\" alt=\"awoo logo\" /\u003e\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  a general, lightweight framework for parsing loads of files\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ci\u003eby extension, a static site generator\u003c/i\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- Stability --\u003e\n  \u003ca href=\"https://nodejs.org/api/documentation.html#documentation_stability_index\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/stability-stable-green.svg?style=flat-square\"\n      alt=\"API stability\" /\u003e\n  \u003c/a\u003e\n\n  \u003c!-- travis ci --\u003e\n  \u003ca href=\"https://travis-ci.org/awoojs/awoo\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/awoojs/awoo.svg?style=flat-square\"\n      alt=\"test status\" /\u003e\n  \u003c/a\u003e\n\n  \u003c!-- npm version --\u003e\n  \u003ca href=\"https://npmjs.org/package/awoo\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/awoo.svg?style=flat-square\"\n      alt=\"npm version\" /\u003e\n  \u003c/a\u003e\n\n  \u003c!-- package size --\u003e\n  \u003ca href=\"https://packagephobia.now.sh/result?p=awoo\"\u003e\n    \u003cimg src=\"https://packagephobia.now.sh/badge?p=awoo\"\n      alt=\"package size\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Example](#example)\n- [How does it work?](#how-does-it-work)\n- [API Documentation](#api-documentation)\n- [Plugins](#plugins)\n- [Development Setup](#development-setup)\n- [How does it compare?](#how-does-it-compare)\n- [What dependencies does it have?](#what-dependencies-does-it-have)\n- [License](#license)\n\n## Features\n\n- __extremely simple__: the API exposes _one function_!\n- __easy to understand__: only ~180 SLOC!\n- __very modern__: works very well with async functions (node 7.6+)\n- __fast as lightning__: because it's so simple, it takes almost no time to build a site!\n\n## Installation\n\nYou need Node.js __7.6__ or higher.\n\n```sh\nnpm install --save awoo\n```\n\n## Example\n\nLet's write a simple program that changes the content of all files in a\ndirectory to \"hey, what's up\":\n\n```js\nconst awoo = require('awoo')\n\n// this is the simplest plugin you can build!\n// conveniently, plugins are just normal functions\nconst plugin = () =\u003e {\n  // replace all file contents with the string\n  return files =\u003e files.map(file =\u003e {\n    file.contents = `hey, what's up`\n    return file\n  })\n}\n\n// enter our main function:\n// the main function should be an async function so that\n// it automatically returns a promise\nawoo(async site =\u003e {\n  // we register our plugin...\n  site.use(plugin)\n  // ...and initiate the build process\n  return site\n})\n```\n\nLet's save this as `example.js`. To run it, you need Node.js version 7.6 or\nhigher. The latest stable version will work.\n\n```sh\nnode example.js\n```\n\n`awoo` doesn't output logs by default. If you want logs\n(for example, for debugging), you can set the `DEBUG` environment variable to:\n\n```sh\nawoo # for base logs\nawoo:read # for specific read logs\nawoo:write # for specific write logs\n\n# you can also combine any of the three\nawoo,awoo:read\n```\n\nTo get all logs at once, you can just set the variable to `awoo*`.\n\n```bash\nDEBUG=awoo* node my_script # full logging!\n```\n\n`awoo` plugins may implement logging with different `DEBUG` names.\n\n## How does it work?\n\nIt's fairly simple! What `awoo` does can be split up into two things:\n\n- First, it reads a directory and saves all of the information about each file\n  into a gigantic array. That object can be manipulated by _plugins_, which\n  makes `awoo` actually do things.\n- After most plugins are run, `awoo` writes the files as they are described\n  in the gigantic array to disk.\n\nIt's that simple! Static site generators aren't rocket science or whatever.\nIf you got confused by looking at the Jekyll source code once, that's because\nJekyll is more fully fledged than `awoo` is, that is, it provides some defaults.\n\nBut static site generators, at their core, are just programs that take a set of\nfiles, do something to them, and then output those files. That's it. The rest is just _transformations_ on those files.\n\n`awoo`'s goal is to reduce that essence to its very base, and to give you a\nbunch of building blocks with which you can make your ideal site, using only\nthe stuff you need!\n\n## API Documentation\n\nThe [docs](https://awoo.js.org/docs) are published on our website.\n\n## Plugins\n\nOfficial plugins are kept at [awoojs/core](http://github.com/awoojs/core)!\n\nSince it's really easy to write `awoo` plugins, anyone can make and publish one!\nIf you make a plugin, you should add a GitHub topic `awoo` and probably also\nadd `awoo` as a keyword in your `package.json`.\n\n[Here's a list of all awoo plugins on GitHub](https://github.com/search?utf8=%E2%9C%93\u0026q=topic%3Aawoo\u0026type=)\n\n## Development\n\nTo work on this repository, clone it and install the npm dependencies:\n\n```sh\ngit clone https://github.com/awoojs/awoo.git\ncd awoo\nnpm install\n```\n\nThere are a couple of npm scripts provided for convenience:\n\n- `npm test` - runs linters and ava in ci mode\n- `npm run lint` - runs linters\n- `npm run ava` - only runs ava once\n- `npm run ava:ci` - runs ava in ci mode (generates coverage data)\n- `npm run ava:watch` - runs ava in watch mode\n- `npm run coverage` - generates coverage data\n- `npm run update-coc` - pulls the latest `weallbehave` code of conduct\n- `npm run deploy` - publishes npm package using `np`\n\n## How does it compare?\n\nThis section is a little bit about how `awoo` compares to other static site\ngenerators (even though it isn't really that):\n\n- __jekyll__: Jekyll is a whole lot different. First off, it provides a whole\n  lot of defaults (such as YAML Front-Matter, the Liquid language, etc) to\n  help you build your static site extremely quickly. It's also massively\n  geared for security, since it runs on GitHub's Pages platform. Stuff like\n  custom plugins isn't even available there (not like that's a bad thing!).\n- __hugo__: Hugo, a bit like Jekyll, has predefined concepts like \"pages\" and\n  \"tags\".\n- __metalsmith__: Metalsmith is probably the thing that's most like `awoo`, and\n  as a matter of fact, its main inspiration. It's also plugin-based, and works\n  with roughly the same concepts. The major difference is that `awoo` is more\n  up-to-date (I like promises a lot) and that the API is fairly different.\n  Also, it's just not really an active project with an active ecosystem\n  anymore (sadly!).\n\n## What dependencies does it have?\n\n- [`deepmerge`](http://npm.im/deepmerge) - used to handle configuration management\n- [`walk`](http://npm.im/walk) - walks through directories to read them\n- [`trough`](http://npm.im/trough) - handles middleware chains\n- [`debug`](http://npm.im/debug) - used for logging\n- [`to-vfile`](http://npm.im/to-vfile) - converts to `vfile`, the virtual file format used by `awoo`\n- [`mkdirp`](http://npm.im/mkdirp) - creates directories when writing to disk\n- [`is-text-path`](http://npm.im/is-text-path) - provides logic to correctly read binary files\n\nIf you have any ideas as to how to eliminate a dependency, you're more than\nwelcome to pitch it in a new issue!\n\n## Maintainers\n\n- Olivia Hugger \u003c[olivia@fastmail.com](mailto:olivia@fastmail.com)\u003e\n\n## Code of Conduct\n\nThis repository operates under the [`weallbehave`](https://github.com/wealljs/weallbehave) Code of Conduct. Its contents can be found in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).\n\n## License\n\nGNU AGPLv3 (see LICENSE document)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawoojs%2Fawoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawoojs%2Fawoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawoojs%2Fawoo/lists"}