GithubHelp home page GithubHelp logo

dep5-it's Introduction

Dep5It - Debian Copyright (dep5) Management Library

Parses machine-interpretable Debian Copyright files (.dep5) into object files.

This can be valuable when extracting License and Copyright statements from the configuration file.

Features

  • Easy to use
  • Parsing of Debian Copyright files into objects

Basic Usage

Parsing a Debian Copyright file

import { DebianCopyright } from "@dev-build-deploy/dep5-it";

// Parse a .dep5 file
const dep5 = DebianCopyright.fromFile(".reuse/dep5");

// Show the results
console.log(JSON.stringify(dep5, null, 2));
Example output
{
  "header": {
    "format": "https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/",
    "upstreamName": "dep5-it",
    "upstreamContact": [
      "Kevin de Jong <[email protected]>"
    ],
    "source": "https://github.com/dev-build-deploy/dep5-it"
  },
  "files": [
    {
      "files": [
        "test/fixtures/*"
      ],
      "copyright": "2023 Kevin de Jong <[email protected]>",
      "license": "MIT"
    },
    {
      "files": [
        "tsconfig*.json"
      ],
      "copyright": "2023 Kevin de Jong <[email protected]>",
      "license": "CC0-1.0"
    },
    {
      "files": [
        "package*.json"
      ],
      "copyright": "2023 Kevin de Jong <[email protected]>",
      "license": "CC0-1.0"
    }
  ]
}

Retrieve specific File Stanzas

You can filter on the file stanza associated with the given file name:

import { DebianCopyright } from "@dev-build-deploy/dep5-it";

// Parse a .dep5 file
const dep5 = DebianCopyright.fromFile(".reuse/dep5");

// Retrieve specific File Stanza
const fileStanza = dep5.getFileStanza("test/fixtures/basic-file.dep5.fixture");

console.log(JSON.stringify(fileStanza, null, 2));
Example output
{
  "files": [
    "test/fixtures/*"
  ],
  "copyright": "2023 Kevin de Jong <[email protected]>",
  "license": "MIT"
}

Contributing

If you have suggestions for how dep5-it could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

dep5-it's People

Contributors

kevin-de-jong avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.