- 💫 Beautifier - Javascript/JSON, XML, HTML, CSS, SQL
- 💨 Minifier - Javascript, JSON, XML, CSS, SQL
- 🔑 Hash - Hash strings with md5 and sha1, sha256, sha512
- 📋 Paste - Pastebin-like feature, with expiry, download and raw view
- ⟿ Encode - URL, Base64
- ⟵ Decode - URL Encode, Base64
- production ready with properly minified, compressed and bundled assets
- pm2 to manage and scale node processes
- Time manipulation/converter
- Encrypt Pastes
- Dockerize
- Add unit tests
- Benchmark
- Node.js
- MongoDB
npm install
npm run build
This transpiles *.js files, and copies other files (css/etc), from /src to /lib
It uses gulp build
task as defined in the .gulpfile
While developing, use:
npm run gulp -- build watch
This builds the project and then watches /src for file changes and compiles only the changed files.
You can let this run in the background while developing. (you'll still need to restart the server for certain changes to take effect.)
npm run start
Koa is an excellent minimalist server framework on node.
Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs.
Babel is a JavaScript compiler. es6/7 is great.
ECMAScript 2015 is the newest version of the ECMAScript standard.
Babel transpiles new ES2015 (and ES2016) syntax into ES5 valid code.
Lasso.js is an open source Node.js-style JavaScript module bundler from eBay. It also provides first-level support for optimally delivering JavaScript, CSS, images and other assets to the browser.
It's like Webpack + Browserify/jspm/RequireJS
Marko is a really fast and lightweight HTML-based templating engine that compiles templates to CommonJS modules and supports streaming, async rendering and custom tags.
Ideal for fast development, using mongoose
│ package.json
│ gulpfile.js
│ .babelrc
│ .gitignore
│ README.md
│
├───src
│ │
│ │ index.js // basic initial configuration (babel, sourcemaps)
│ │
│ │ server.js // Koa server and configuration
│ │ // exports the koa `app` which can be required elsewhere
│ │ // imports /routes/xxx
│ │
│ ├───routes
│ │ │ layout.marko // basic layout
│ │ │
│ │ ├───beautify
│ │ │ index.js
│ │ │ template.marko
│ │ ├───hash
│ │ │ index.js
│ │ │ template.marko
│ │ ├───home
│ │ │ index.js // route logic
│ │ │ template.marko // marko template (extends from layout.marko)
│ │ │ widget.js // marko-widget (better client-side javascripting)
│ │ ├───minify
│ │ │ index.js
│ │ │ template.marko
│ │ ├───paste
│ │ │ index.js
│ │ │ template.marko
│ │ │ otemplate.marko // this one has a specific output template
│ │ │ browser.json // for lasso
│ │ │
│ │ └───...
│ │
│ ├───db
│ │ └───... // db schema for Paste
│ └───public
│ └───... // public resources exposed as static files
│
│
├───lib (auto-generate)
│ │ // /src gets compiled here, the project mainly runs from here
│ │ // .js files from /src gets compiled to .js files here
│ │ // other than .js files get copied as is (css, fonts etc)
│ │
│ ├───public
│ │ │
│ │ └────lasso
│ │ └────... // lasso related bundled files are auto-generated here
│ │
│ └───... whole lib is .gitignore’d as it's essentially just a dumplicate of /src
│
├───.cache (auto-generated, lasso related, .gitignore’d)
│
└───node_modules // (.gitignore’d)
This file sets up preliminaries:
- babel
- sourcemap-support
- Bluebird as the default promise library
Sets up Koa 2 and most used modules
- Static files server from
/public
- Body Parser (for form submission/file updloads)
- Marko (Templating Language)
- Lasso (Bundler)