open-index/open-npm huggingface dataset:
npm package: @openscd/open-scd-core
Description: The core editor of OpenSCD, without any extensions
Author: OMICRON Electronics GmbH
Latest version: 0.0.2

# OpenSCD Core
## \<open-scd>

## Installation

```sh
npm i open-scd
```

## Usage

```html
<script type="module">
  import 'open-scd/open-scd.js';
</script>

<open-scd></open-scd>
```

## Linting and formatting

To scan the project for linting and formatting errors, run

```sh
npm run lint
```

To automatically fix linting and formatting errors, run

```sh
npm run format
```

We use ESLint and Prettier for linting and formatting. Plugins for automatic
formatting and linting during editing are available for vim, emacs, VSCode,
and all popular IDEs.

## Testing with Web Test Runner

To execute a single test run:

```sh
npm test
```

To run the tests in interactive watch mode run:

```sh
npm run test:watch
```

## Tooling configs

For most of the tools, the configuration is in the `package.json` to reduce the
amount of files in the project.

## Local Demo with `web-dev-server`

```sh
npm start
```

To run a local development server that serves the basic demo located in `demo/index.html`

> This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.

## License

This project is licensed under the [Apache License 2.0](LICENSE).

&copy; 2022 OMICRON electronics GmbH
npm package: @openscd/oscd-api
Description: OpenSCD API for IEC 61850 SCL files
Author: OMICRON Electronics GmbH
Latest version: 0.1.6

[![Tests](https://github.com/openscd/oscd-api/actions/workflows/test.yml/badge.svg)](https://github.com/openscd/oscd-api/actions/workflows/test.yml) ![NPM Version](https://img.shields.io/npm/v/@openscd/oscd-api)

# OpenSCD API

This package defines a common set of APIs, types, and interfaces for use by [OpenSCD](https://openscd.org) distributions and plugins.  
It does **not** contain any business logic or implementation—only the shared contracts that enable interoperability between OpenSCD core, plugins, and distribution builders.

## Purpose

- **For Plugin Developers:**  
  Provides the types and event interfaces needed to build plugins that integrate seamlessly with OpenSCD core.  
  See [docs/plugin-api.md](docs/plugin-api.md) for a detailed description of the plugin API.

- **For Distribution Builders:**  
  Supplies the types and interfaces for the OpenSCD root element and other extension points.  
  _API documentation for the OpenSCD root element and constraints for `plugin.json` will be provided in future docs._

## Documentation

- [Plugin API](docs/plugin-api.md):  
  Comprehensive guide for plugin authors, including property contracts, event types, and theming.

- _Additional documentation (e.g., for the OpenSCD root element and `plugin.json` constraints) will be added soon._

## License

[Apache-2.0](LICENSE)
npm package: @openscd/oscd-editor
Description: Function library for basic XML manipulations
Author: OMICRON electronics GmbH
Latest version: 1.8.0

This repository hold the XML editing engine, following the newest agreed [OpenSCD Plugin API](https://github.com/openscd/oscd-api/blob/main/docs/plugin-api.md)

## Usage

You can either load and use the `handleEdit` function through npm or other content delivery networks. This function does manipulate a XMLDocument as per user intent through the edit as its input:

```ts
const removeNode: Remove = { node: toBeRemovedNode };
handleEdit(removeNode);
```

You can also use the exported `EditV2Editor` class which keeps track of an undo/redo
history. This class is a wrapper around the `handleEdit` function and provides
a more user-friendly API. The `EditV2Editor` class can be used as follows:

```ts
import { EditV2Editor } from '@openscd/oscd-editor';

const editor = new EditV2Editor();

const removeNode: Remove = { node: toBeRemovedNode };
editor.handleEdit(removeNode);

expect(toBeRemovedNode.parentNode).to.not.exist;

editor.undo(); // undo the latest edit

expect(toBeRemovedNode.parentNode).to.exist;

editor.redo(); // redo the most recently undone edit

expect(toBeRemovedNode.parentNode).to.not.exist;
```

## Linting and formatting

To scan the project for linting and formatting errors, run

> npm run lint

To automatically fix linting and formatting errors, run

> npm run format

We use ESLint and Prettier for linting and formatting. Plugins for automatic formatting and linting during editing are available for vim, emacs, VSCode, and all popular IDEs.

## Testing with Web Test Runner

To execute a single test run:

> npm test

To run the tests in interactive watch mode run:

> npm run test:watch

# License

This project is licensed under the Apache License 2.0.

© 2025 Jakob Vogelsang, OMICRON electronics GmbH
npm package: @openscd/scl-lib
Description: Function library supporting SCL editing
Author: Jakob Vogelsang
Latest version: 2.0.0

# scl-lib

This repository - SclLib - is a collection of TypeScript functions, that allow to faster develop modules for SCL editing.

## Content

SclLib is primarily exporting functions, that allow to manipulate SCL elements.
There are various types of functions you can find in this library grouped into:

- <u>element creation</u>: Those functions are triggered by the wish to create a valid SCL element. Those functions do check primarily whether limitation to create such an element are met.

  - The input is the parent/ancestor element and and an options object defining a user-defined configuration of the element to be created.
  - The output is a delta compared to the current SCL

- <u>edit checks</u>: Those function are triggered by the wish to edit a specific SCL element, e.g. `GSEControl`.

  - The input is a delta to the actual SCL formulated as `SetAttributes`, `Insert` or `Remove`.
  - The output is a corrected delta formulated as an array of `SetAttributes`, `Insert` or `Remove`. The difference between the input and output contains expertise related to IEC 61850-6.

- <u>generators</u>: Generator functions that allow to dynamically create unique value such as MAC-addresses, APPID and others