Giter Site home page Giter Site logo

launchdarkly-typegen's Introduction

LaunchDarkly TypeScript Generator

Type-safe flag evaluations for LaunchDarkly.

Note: This is a third-party tool with no affiliation to LaunchDarkly.

Introduction

This CLI tool will fetch flags from a LaunchDarkly project and render them to TypeScript definitions.

The output can then be imported across your application to give build-time checks to your flag evaluations.

Example

export interface AppFlagSet {
  'feature-one': boolean;
  'feature-two': boolean;
}

export type AppFlag = keyof AppFlagSet;

export type FlagEnvironment = 'staging' | 'production';

Installation

npm install -D launchdarkly-typegen

Usage

launchdarkly-typegen

Usage:
  $ launchdarkly-typegen <command> [options]

Options:
  --output [file]               Path to generated file (default: output to stdout)
  --project [project]           LaunchDarkly project key (default: default)
  --flag-interface-name [name]  Name of the generated flag interface (default: AppFlagSet)
  --env-type-name [name]        Name of the generated environment union type (default: FlagEnvironment)
  --api-key [key]               LaunchDarkly API key (if not set, will attempt to use LAUNCHDARKLY_API_KEY from the environment)
  -h, --help                    Display this message

TODO

  • Fetch flag keys and their types
  • Fetch environment keys
  • Support >100 flags/environments
  • Support non-boolean flag types

launchdarkly-typegen's People

Contributors

jonlambert avatar

Stargazers

Antanas Misiūnas avatar

Watchers

 avatar  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.