Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hylite

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hylite - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

.github/workflows/build.yml

11

package.json
{
"name": "hylite",
"version": "0.1.0",
"version": "0.2.0",
"description": "A command line tool for highlighting code",

@@ -17,10 +17,15 @@ "author": "Peter @peterbe Bengtsson",

"scripts": {
"test": "echo 'not done yet'",
"css": "bun run src/index.ts -c",
"list-css": "bun run src/index.ts --list-css",
"install:husky": "husky install",
"test": "bun test",
"lint": "prettier --check \"src/**/*.ts\"",
"prettier": "prettier --write \"src/**/*.ts\"",
"build": "bun run src/build.ts",
"release": "np",
"prerelease": "bun build ./src/index.ts --outdir=dist --outfile=index.js"
"prerelease": "bun run build"
},
"devDependencies": {
"bun-types": "latest",
"husky": "^8.0.3",
"np": "^8.0.4",

@@ -27,0 +32,0 @@ "prettier": "^3.0.3"

@@ -19,2 +19,3 @@ #!/usr/bin/env bun

.option("--list-css", "List possible names for CSS files and exit")
.option("--version", "Prints the current version")
.argument("[string]", "string to highlight");

@@ -42,3 +43,3 @@

}
} else if (options.listCss) {
} else if (options.listCss || options.version || options.css) {
// pass

@@ -72,2 +73,3 @@ } else {

listCss: options.listCss,
version: options.version,
});

@@ -84,2 +86,3 @@

listCss = false,
version = false,
}: {

@@ -92,4 +95,10 @@ htmlWrap?: boolean;

listCss?: boolean;
version?: boolean;
} = {},
) {
if (version) {
const packageJson = require("../package.json");
process.stdout.write(`${packageJson.version}\n`);
return;
}
if (listCss) {

@@ -178,3 +187,3 @@ const cssNames = await getCSSNames();

if (url.pathname === "/") {
let choicesHtml = "<ul class=choices>";
let choicesHtml = '<ul class="choices">';
for (const name of cssNames) {

@@ -188,3 +197,14 @@ choicesHtml += `<li><a href="?css=${name}">${name}</a></li>`;

const css = await getCSS(loadedCssName);
let css = "";
try {
css = await getCSS(loadedCssName);
} catch (error) {
if (
error instanceof Error &&
"code" in error &&
error.code === "ENOENT"
) {
return new Response("css file not found", { status: 400 });
}
}

@@ -191,0 +211,0 @@ const headStyle = getHeadStyle(loadedCssName);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc