New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@zeroc/slice2js

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zeroc/slice2js

Slice-to-JavaScript compiler and build plugin for Ice

latest
Source
npmnpm
Version
3.8.1
Version published
Weekly downloads
23
Maintainers
3
Weekly downloads
 
Created
Source

@zeroc/slice2js

The Slice-to-JavaScript compiler and build plugin for Ice.

This package provides:

  • The slice2js compiler, which compiles Slice definitions (.ice files) into JavaScript and TypeScript.
  • Build plugins for Vite, Rollup, webpack, and esbuild via unplugin.
  • A programmatic API for running the compiler.

Installation

npm install --save-dev @zeroc/slice2js

Build Plugin

The build plugin compiles .ice files automatically during your build. It supports glob patterns and watches .ice files for changes in development mode.

Vite

// vite.config.js
import slice2js from "@zeroc/slice2js/unplugin/vite";

export default {
    plugins: [
        slice2js({
            inputs: ["slice/*.ice"],
            outputDir: "src/generated",
            args: ["--typescript"],
        }),
    ],
};

Rollup

// rollup.config.js
import slice2js from "@zeroc/slice2js/unplugin/rollup";

export default {
    plugins: [
        slice2js({
            inputs: ["slice/*.ice"],
            outputDir: "src/generated",
            args: ["--typescript"],
        }),
    ],
};

webpack

// webpack.config.js
import slice2js from "@zeroc/slice2js/unplugin/webpack";

export default {
    plugins: [
        slice2js({
            inputs: ["slice/*.ice"],
            outputDir: "src/generated",
            args: ["--typescript"],
        }),
    ],
};

esbuild

import esbuild from "esbuild";
import slice2js from "@zeroc/slice2js/unplugin/esbuild";

await esbuild.build({
    plugins: [
        slice2js({
            inputs: ["slice/*.ice"],
            outputDir: "src/generated",
            args: ["--typescript"],
        }),
    ],
});

Plugin Options

OptionTypeDescription
inputsstring | string[]Slice files or glob patterns (e.g. "**/*.ice")
outputDirstringOutput directory for generated .js and .d.ts files
includestring | string[]Additional Slice include directories (-I flags)
argsstring | string[]Additional slice2js CLI arguments (e.g. --typescript)
cwdstringBase directory for resolving paths (defaults to process.cwd())

Programmatic API

runSlice2js(options)

Compiles Slice files with glob support and include directory resolution:

import { runSlice2js } from "@zeroc/slice2js/unplugin";

await runSlice2js({
    inputs: ["slice/*.ice"],
    outputDir: "src/generated",
    args: ["--typescript"],
});

compile(args, options)

Low-level function that spawns the slice2js compiler directly:

import { compile } from "@zeroc/slice2js";

const exitCode = await compile(["--typescript", "--output-dir", "src/generated", "slice/Hello.ice"]);

Keywords

Ice

FAQs

Package last updated on 02 Mar 2026

Did you know?

Socket

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.

Install

Related posts