Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
barely-a-dev-server
Advanced tools
A thin, opinionated wrapper for `esbuild` as a `.ts` web server. Given an `entryRoot` folder, it:
barely-a-dev-server
A thin, opinionated wrapper for esbuild
as a .ts
web server. Given an entryRoot
folder, it:
.ts
files under entryRoot
and uses them as entry files to run esbuild
in watch
mode, and.js
files together with a fallback to entryRoot
for static files.
/
are mapped to index.html
in the corresponding folder.When run with "dev": false
, it writes these files to an output dir (dist/
+ the entry root by default), ready to serve using your favorite static file server.
// script/build.js
import { barelyServe } from "barely-a-dev-server";
barelyServe({
entryRoot: "src", // the only required arg
dev: true,
port: 3333,
esbuildOptions: {
target: "esnext",
},
});
<!-- src/index.html -->
<script src="./index.js" href="./index.ts" type="module" defer></script>
// src/index.ts
const a: number = 4;
console.log(a);
(Note that src
must reference the .js
file, not .ts
. The example shows a hack: you can use href
to store a reference to the .ts
source, which works with e.g. "Follow link" in VSCode.)
barely-a-dev-server
?barely-a-dev-server
?node -e 'import("barely-a-dev-server").then(s => s.barelyServe({entryRoot: "src"}))'
These are mostly because it would make the codebase significantly larger to support them properly.
FAQs
A thin, opinionated wrapper for [`esbuild`](https://github.com/evanw/esbuild) as a `.ts` web server. Given an `entryRoot` folder, it:
The npm package barely-a-dev-server receives a total of 25 weekly downloads. As such, barely-a-dev-server popularity was classified as not popular.
We found that barely-a-dev-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.