https://github.com/dwiyatci/hodor-loader
:godmode: A webpack loader for hodorifying JavaScript code
https://github.com/dwiyatci/hodor-loader
hodor hodor-loader webpack wtfpl
Last synced: 3 months ago
JSON representation
:godmode: A webpack loader for hodorifying JavaScript code
- Host: GitHub
- URL: https://github.com/dwiyatci/hodor-loader
- Owner: dwiyatci
- License: wtfpl
- Created: 2016-06-02T20:20:39.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:55:54.000Z (over 3 years ago)
- Last Synced: 2025-09-21T16:44:52.330Z (10 months ago)
- Topics: hodor, hodor-loader, webpack, wtfpl
- Language: JavaScript
- Homepage:
- Size: 4.84 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# hodor-loader
```
_| | |_ _ _ _ _ _ _
|_ . _|| |_ ___ | | __| | | |_ | |_ ___ __| | ___ ___ _ _
|_ _|| ' \ / _ \ | | / _` | | _| | ' \ / -_) / _` | / _ \ / _ \ | '_|
|_|_| |_||_| \___/ _|_|_ \__,_| _\__| |_||_| \___| \__,_| \___/ \___/ _|_|_
_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'
```
[](https://travis-ci.org/dwiyatci/hodor-loader)
[](https://codecov.io/gh/dwiyatci/hodor-loader)
[](https://www.npmjs.com/package/hodor-loader)
[](http://npm-stat.com/charts.html?package=hodor-loader)
[](https://raw.githubusercontent.com/dwiyatci/hodor-loader/master/LICENSE.txt)
This [webpack](https://webpack.js.org) loader allows statically replacing string literal and literal template syntax in JavaScript source code with [Hodor](http://awoiaf.westeros.org/index.php/Hodor) before it gets bundled and interpreted.
Smells like an experimental manipulative Lexer, huh?!
**Heads-up:** I simply do this for fun; use at your own risk.

> Hold the door! Holddoor! Hodor! https://youtu.be/5DoBY8M_bCg
### Why?
- HODOR IS ~~**NOT**~~ DEAD.
- [You canโt beat Tape ๐ผโ](https://medium.com/javascript-scene/why-i-use-tape-instead-of-mocha-so-should-you-6aa105d8eaf4)
## Installation
```bash
npm isntall hodor-loader --save-dev
```
## Usage
[Documentation: Using loaders](https://webpack.js.org/concepts/#loaders)
## Example
Given this webpack config:
```javascript
{
// ...,
module: {
rules: [
{
test: /\.m?js$/,
use: 'hodor-loader'
}
]
},
// ...
}
```
It will transform the matching JS file source code, e.g.
```javascript
console.log('hello, world');
document.querySelector('#app').textContent = 'the quick brown fox jumps over a lazy dog';
// alert("hold the door");
document.writeln('hold, the; door!');
const x = 42;
console.log(`the answer is ${x}`);
```
...into:
```javascript
console.log('HODOR, HODOR');
document.querySelector('#HODOR').textContent =
'HODOR HODOR HODOR HODOR HODOR HODOR HODOR HODOR HODOR';
// alert("hold the door");
document.writeln('HODOR, HODOR; HODOR!');
const x = 42;
console.log(`HODOR HODOR HODOR HODOR`);
```
## Author
Glenn Dwiyatcita ([@dwiyatci](http://tiny.cc/dwiyatci))
## License
WTFPL โ Do What the Fuck You Want to Public License.
See [LICENSE.txt](LICENSE.txt).
