New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@teambit/harmony

Package Overview
Dependencies
Maintainers
16
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teambit/harmony

abstract extension system

  • 0.4.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.4K
increased by157.44%
Maintainers
16
Weekly downloads
 
Created
Source

Harmony

Harmony is the engine that drives Bit extensibility and composability. It's an abstract extension system indended to make any software extendable and composable.

Harmony takes a "micro-kernel" approach and implements the near-minimum amount of software required to build any JavaScript system from independent components through composition.

Installation

$ bit install @teambit/harmony

Quick start

import { Harmony, Extension } from 'harmony';

@Extensioin
class Person {
  sayHello(name = 'world') {
    return `hello ${name}!`;
  }
}

const person = Harmony.load(Person); 
helloWorld.sayHello(); // returns 'hello world!'

Component composition

DI

class Dude {
  constructor(
    private person: Person
  ) {}

  sayHello() {
    return this.person.sayHello('dude');
  }
};

Harmony.load([Dude]).sayHello(); // echos 'hello dude!'

Hooks

@Extension()
class CLI {
  // @hook('command') commands = Hook.create<Command>();
  static command() {
    return Hook.create<Command>();
  }

  run() {
    const allCommands = this.commands.list(); // outputs all hook subscribers
  }
} 

@Extension()
class Compiler {
  
  @command()
  main() {
    return {
      synopsis: 'compile <path>',
      render: () => <Box></Box>
    };
  }
}

Extension configuration

Extension metadata

API reference

License

Apache License, Version 2.0

Made with ❤ to open software by Team Bit.

Keywords

FAQs

Package last updated on 12 Dec 2022

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

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