{"id":18834,"library":"stylish","title":"stylish","description":"Stylus middleware for Connect/Express that compiles Stylus to CSS in memory without writing files to disk. Version 1.0.0 is the latest stable release, with no recent updates. It serves as a drop-in replacement for stylus.middleware(), offering optional compression, nib support, file change callbacks, and caching for production. Unlike the default Stylus middleware, it avoids disk writes and includes built-in file watching and dependency tracking.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/marcello3d/node-stylish","tags":["javascript","stylus","middleware","connect"],"install":[{"cmd":"npm install stylish","lang":"bash","label":"npm"},{"cmd":"yarn add stylish","lang":"bash","label":"yarn"},{"cmd":"pnpm add stylish","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for compiling Stylus files; must be >=0.40.0","package":"stylus","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require works in Node but without default import syntax. Use ES module import for correct usage.","wrong":"const stylish = require('stylish')","symbol":"default","correct":"import stylish from 'stylish'"},{"note":"Default export, not named export.","wrong":"import { stylish } from 'stylish'","symbol":"stylish","correct":"import stylish from 'stylish'"},{"note":"Call as a function returning middleware, not a constructor.","wrong":"const mw = new stylish()","symbol":"Middleware options","correct":"const mw = stylish({ src: __dirname + '/public', compress: true })"}],"quickstart":{"code":"import express from 'express'\nimport stylish from 'stylish'\nimport nib from 'nib'\n\nconst app = express()\nconst port = 3000\n\napp.use(stylish({\n  src: __dirname + '/public',\n  compress: true,\n  setup: function(renderer) {\n    return renderer.use(nib())\n  }\n}))\n\napp.listen(port, () => {\n  console.log(`Server running on port ${port}`)\n})","lang":"javascript","description":"Sets up Express app with stylish middleware for Stylus compilation, including nib support and compression."},"warnings":[{"fix":"npm install stylus@>=0.40.0","message":"Package version 1.0.0 has no breaking changes documented, but ensure stylus peer dependency >=0.40.0 or compilation may fail.","severity":"breaking","affected_versions":"*"},{"fix":"Use cache: true only in production for performance; during development omit cache to enable live reload.","message":"If cache option is true, file watching is disabled and CSS is cached in memory; changes to .styl files won't be picked up until server restart.","severity":"gotcha","affected_versions":"*"},{"fix":"Serve CSS directly via middleware; do not expect .css files in the src directory.","message":"The package does not write compiled CSS to disk; ensure your app doesn't rely on static .css files being present on the filesystem.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'1.0.0':19 'avoid':57 'built':63 'built-in':62 'cach':48 'callback':46 'chang':45 'compil':7 'compress':41 'connect':73 'connect/express':5 'css':10 'default':53 'depend':68 'disk':17,58 'drop':34 'drop-in':33 'file':15,44,65 'includ':61 'javascript':70 'latest':22 'memori':12 'middlewar':3,55,72 'nib':42 'offer':39 'option':40 'product':50 'recent':27 'releas':24 'replac':36 'serv':30 'stabl':23 'stylish':1 'stylus':2,8,54,71 'stylus.middleware':38 'support':43 'track':69 'unlik':51 'updat':28 'version':18 'watch':66 'without':13 'write':14,59","created_at":"2026-04-25T07:40:22.623715+00:00","updated_at":"2026-04-25T07:40:22.623715+00:00","problems":[{"fix":"npm install stylish","cause":"Package not installed or not in node_modules","error":"Cannot find module 'stylish'"},{"fix":"Use 'import stylish from 'stylish'' and call as stylish({...})","cause":"Attempted to use stylish as a constructor (e.g., new stylish()) or imported named instead of default","error":"stylish is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.4.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/marcello3d/node-stylish","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/stylish","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}