StrawJS is a new approach to static site generation. In StrawJs, your website source code is a runnable block of JavaScript that leverages the powerful ergonomics found in RawJS. StrawJS isn't another pile of plugins, preprocessors, and configuration. Rather, it's a lightweight static site generation library.
$ npx strawjs init
require("strawjs");
const straw = new Straw.Site();
straw.page("/",
<h1>Welcome to my website!</h1>
);
straw.emit();
...then hit the run and debug button in Visual Studio Code, and your website is built.
Read the full documentation page
Axe the pre-processors and use JavaScript for everything.
The elegance of RawJS combined with its best-in-class CSS-within-JS feature means you can use JavaScript as your one language for everything. End the hodge-podge of EJS, Handlebars, SASS, LESS, and endless other preprocessors that are all basically less-featured versions of JavaScript. Want something like an HTML import or a CSS @include? Make a function and call it.
straw.page("/",
mySharedHeader(),
<h1>Welcome to my website!</h1>,
mySharedFooter()
);
Code your website with the full power of JavaScript.
Remember—StrawJS is a static site generation library. It allows your website to become a giant emitter function written in JavaScript. Step-debugging is a first-class feature. Want some pages to be generated from a database? Just make your emitter function do this. You don't have to worry about plugins or hooking into some API.
Read the full documentation page
Image processing done right.
StrawJS uses the ultra-fast rust-based Photon library for on-the-fly image processing. It generates size, crop, and effects variations from source images according to your specs, and auto-resolves file extensions and source paths.
straw.page("/products/my-product",
raw.img({ src: "my-image?w=300,sat=-100" }),
straw.icon("favicon"),
);
See all image processing options
Fast.
When your entire website is readily-executable JavaScript code, you avoid the weight and bloat caused by preprocessors that have to deal with parsing and transformation.
Maintained.
StrawJS is being used to support a number of production websites, including this one. It's also the official library for creating webfeeds, which is the foundational technology that powers the content in Squares, a funded social media technology app.
Visit the GitHub Repository