
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
zero-configuration web server with built in pre-processing
Harp is a static web server that also serves Jade, Markdown, EJS, Less, Stylus, Sass, and CoffeeScript as HTML, CSS, and JavaScript without any configuration. It supports the beloved layout/partial paradigm and it has flexible metadata and global objects for traversing the file system and injecting custom data into templates. Optionally, Harp can also compile your project down to static assets for hosting behind any valid HTTP server.
Pre-compilers are becoming extremely powerful and shipping front-ends as static assets has many upsides. It's simple, it's easy to maintain, it's low risk, easy to scale, and requires low cognitive overhead. I wanted a lightweight web server that was powerful enough for me to abandon web frameworks for dead simple front-end publishing.
Authored and maintained by @sintaxi.
sudo npm install -g harp
Start Harp server by pointing oit
mkdir ./public
harp ./public
Your Harp application is now running at http://localhost:9000 You can now fill your project with ejs, jade, md, sass, scss files to be processed autmatically.
Compile your project...
harp ./public ./build
Yor dist folder is now ready to be published at a static host such as Surge.sh
Harp can be used as a library or as a command line utility.
Harp ใ Static Web Server v0.46.0
USAGE
harp <source> serves project locally
harp <source> <build> compiles for static host
OPTIONS
-p, --port 9000 server port to listen on
-h, --host 0.0.0.0 server host to answer to
-s, --silent false supresses logs
-h, --help outputs this help message
-v, --version outputs version of harp
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ PROCESSING DATA โ
โ .ejs -> .html _data.json - directory data โ
โ .jade -> .html _data.js - dynamic build data โ
โ .md -> .html โ
โ .sass -> .css GENERATION โ
โ .scss -> .css partial("_path/to/partial", { โ
โ .cjs -> .js "title": "Hello World" โ
โ .jsx -> .js }) โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
You may also use harp as a node library for compiling or running as a server.
Serve up a harp application...
var harp = require("harp")
harp.server(projectPath [,args])
server.listen(port, host)
Or compile harp application
var harp = require("harp")
harp.compile(projectPath [,outputPath] [, callback])
Or use as Connect/ExpressJS middleware
// Express
var express = require("express");
var harp = require("harp");
var app = express();
app.use(express.static(__dirname + "/public"));
app.use(harp.mount(__dirname + "/public"));
app.listen(port, host)
Copyright ยฉ 2012โ2021 Chloi Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the โSoftwareโ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED โAS ISโ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Static Web Server/Generator/Bundler
The npm package harp receives a total of 4,160 weekly downloads. As such, harp popularity was classified as popular.
We found that harp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.