Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

cssbun

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssbun - npm Package Compare versions

Comparing version
1.2.4
to
2.0.0
+1
-1
.github/workflows/test.yml

@@ -16,3 +16,3 @@ name: Node.js Test Runner

matrix:
node-version: [12.x, 14.x]
node-version: [20.x]

@@ -19,0 +19,0 @@ steps:

+15
-11
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
import fs from 'fs';
import path from 'path';
import minimist from 'minimist';
import chokidar from 'chokidar';
import cssbun from './index.js';
const minimist = require('minimist');
const chokidar = require('chokidar');
const argv = minimist(process.argv.slice(2));
const entryFile = argv._[0];
const cssbun = require('./');
const argv = minimist(process.argv);
const entryFile = argv._[2];
const outputFile = argv.o || argv.output;
const outputFilePath = outputFile && path.resolve(outputFile);
function run () {
function run() {
if (!entryFile) {
console.log('You must provide an entryFile as the first argument')
console.log('\n cssbun -o bundled.css css/index.css')
process.exit(1);
}
const result = cssbun(entryFile);

@@ -38,3 +42,3 @@

ignored: outputFile
}).on('change', (path, event) => {
}).on('change', (path) => {
console.log('detected change', path);

@@ -41,0 +45,0 @@ run();

@@ -1,6 +0,5 @@

const path = require('path');
const fs = require('fs');
import path from 'node:path';
import fs from 'node:fs';
import resolve from 'resolve';
const resolve = require('resolve');
function grabFile (fileName, relativeDirectory, bundled, alreadyIncluded) {

@@ -33,5 +32,5 @@ bundled = bundled || '';

module.exports = entryFile => {
export default entryFile => {
const fileName = './' + path.basename(entryFile);
return grabFile(fileName, path.dirname(entryFile), '', []).trim();
};
{
"name": "cssbun",
"version": "1.2.4",
"version": "2.0.0",
"type": "module",
"description": "An extremely lightweight bundler than does nothing but bundles your css files using the import syntax.",

@@ -28,5 +29,5 @@ "main": "index.js",

"dependencies": {
"chokidar": "^3.5.3",
"minimist": "^1.2.7",
"resolve": "^1.22.1"
"chokidar": "^3.6.0",
"minimist": "^1.2.8",
"resolve": "^1.22.8"
},

@@ -37,4 +38,3 @@ "directories": {

"devDependencies": {
"basictap": "^3.4.3",
"c8": "^7.12.0",
"c8": "^9.1.0",
"mithui": "^2.0.9"

@@ -41,0 +41,0 @@ },

@@ -1,10 +0,9 @@

const test = require('basictap');
const cssmin = require('../');
import test from 'node:test';
import assert from 'assert';
import cssmin from '../index.js';
test('bundle single file', t => {
t.plan(1);
test('bundle single file', async () => {
const result = cssmin('./test/scenarios/single/index.css');
t.equal(result, [
assert.strictEqual(result, [
'body {',

@@ -16,8 +15,6 @@ ' background-color: red;',

test('bundle multiple file', t => {
t.plan(1);
test('bundle multiple file', async () => {
const result = cssmin('./test/scenarios/multiple/index.css');
t.equal(result, [
assert.strictEqual(result, [
'.subTest {',

@@ -37,8 +34,6 @@ ' background-color: pink;',

test('bundle file from sub directory', t => {
t.plan(1);
test('bundle file from sub directory', async () => {
const result = cssmin('./test/scenarios/subdirectory/index.css');
t.equal(result, [
assert.strictEqual(result, [
'.subTest {',

@@ -58,8 +53,6 @@ ' background-color: pink;',

test('bundle dependency in sub directory', t => {
t.plan(1);
test('bundle dependency in sub directory', async () => {
const result = cssmin('./test/scenarios/dependencysub/index.css');
t.equal(result, [
assert.strictEqual(result, [
'mui-text-input input:focus {',

@@ -85,8 +78,6 @@ ' border-color: blue;',

test('bundle from dependency', t => {
t.plan(1);
test('bundle from dependency', async () => {
const result = cssmin('./test/scenarios/dependency/index.css');
t.equal(result, [
assert.strictEqual(result, [
'mui-text-input input:focus {',

@@ -112,8 +103,6 @@ ' border-color: blue;',

test('bundle same file twice', t => {
t.plan(1);
test('bundle same file twice', async () => {
const result = cssmin('./test/scenarios/sameFileTwice/index.css');
t.equal(result, [
assert.strictEqual(result, [
'.test {',

@@ -120,0 +109,0 @@ ' background-color: blue;',

.subTest {
background-color: pink;
}
.test {
background-color: blue;
}
body {
background-color: red;
}