11#!/usr/bin/env node
22
33/**
4- * jsserve - Static file server with REST write support
4+ * servejs - Static file server with REST write support
55 * A drop-in replacement for `npx serve` with PUT/DELETE capabilities
66 */
77
@@ -80,7 +80,7 @@ function printBanner(options) {
8080 const mode = readOnly ? 'GET only (read-only)' : 'GET/PUT/DELETE enabled' ;
8181
8282 console . log ( ) ;
83- console . log ( chalk . bgCyan . black ( ' jsserve ' ) ) ;
83+ console . log ( chalk . bgCyan . black ( ' servejs ' ) ) ;
8484 console . log ( ) ;
8585 console . log ( ` ${ chalk . gray ( 'Directory:' ) } ${ directory } ` ) ;
8686 console . log ( ) ;
@@ -106,7 +106,7 @@ function printError(message) {
106106
107107// CLI definition - matching `serve` interface
108108program
109- . name ( 'jsserve ' )
109+ . name ( 'servejs ' )
110110 . description ( 'Static file server with REST write support' )
111111 . version ( pkg . version , '-v, --version' )
112112 . argument ( '[directory]' , 'Directory to serve' , '.' )
@@ -122,19 +122,19 @@ program
122122 . option ( '--ssl-cert <path>' , 'Path to SSL certificate' )
123123 . option ( '--ssl-key <path>' , 'Path to SSL private key' )
124124 . option ( '--no-port-switching' , 'Do not open a different port if specified one is taken' )
125- // jsserve -specific options
125+ // servejs -specific options
126126 . option ( '-r, --read-only' , 'Disable PUT/DELETE methods (like npx serve)' )
127127 . option ( '--write' , 'Enable PUT/DELETE methods (default)' )
128128 . option ( '--auth <credentials>' , 'Enable basic auth (user:pass)' )
129129 . option ( '--solid' , 'Enable full Solid protocol features' )
130130 . option ( '-q, --quiet' , 'Suppress all output' )
131131 . addHelpText ( 'after' , `
132132Examples:
133- $ jsserve Serve current directory with read/write
134- $ jsserve ./public Serve specific directory
135- $ jsserve -p 8080 Use custom port
136- $ jsserve --read-only Read-only mode (like npx serve)
137- $ jsserve -l 3000 ./dist Listen on port 3000, serve ./dist
133+ $ servejs Serve current directory with read/write
134+ $ servejs ./public Serve specific directory
135+ $ servejs -p 8080 Use custom port
136+ $ servejs --read-only Read-only mode (like npx serve)
137+ $ servejs -l 3000 ./dist Listen on port 3000, serve ./dist
138138
139139REST API:
140140 GET /file.txt Read file
0 commit comments