npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jkcfg/std

v0.4.0

Published

jk standard library

Downloads

57,329

Readme

jk

Build Status

Caveat: jk is pre-1.0, and as such, features, commands, and APIs inevitably will change.

Releases within a minor version should be stable; we try to signal breaking changes ahead of time in ./docs/deprecations.md.

jk - configuration as code

jk is a data templating tool designed to help writing structured configuration files.

The main idea behind jk is to use a general purpose language for this task. They offer mature tooling, great runtimes, a well established ecosystem and many learning resources. jk uses Javascript and a runtime tailored for configuration.

Quick start

A good way to start with jk is to read our introduction tutorial. For more context head to our introduction blog post!

More complex examples

Architecture & design

v8

jk itself is a Javascript runtime written in Go and embedding v8. It uses Ryan Dahl's v8worker2 to embed v8 and flatbuffers for the v8 ⟷ Go communication.

Hermeticity

While a general purpose language is great, configuration code can be made more maintainable by restricting what it can do. A nice property jk has to offer is being hermetic: if you clone a git repository and execute a jk script, the resulting files should be the same on any machine. To give concrete examples, this means the jk standard library doesn't support environment variables nor has any networking capability.

Library support

jk provides an unopinionated data templating layer. On top of the jk runtime, libraries provide APIs for users to write configuration.

Roadmap

This project is still in early stages but future (exciting!) plans include:

  • Reach the state of having Kubernetes examples working and well documented.
  • Work on hermeticity. (eg. #110, #44, topic/hermeticity).
  • Native typescript support (#54).
  • HCL support (#94).

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue with the owners of this repository before making a change.

Setup

The jk executable itself is written in Go, but the JavaScript part of this project requires NodeJS.

Prerequisites:

  • go 1.11.4 or later (modules support)
  • nodejs, npm
  • make
  • pkg-config

First off, clone this repository:

$ git clone https://github.com/jkcfg/jk.git
# or with hub:
$ hub clone jkcfg/jk

$ cd ./jk

Then pull most of the dependencies using the Makefile:

$ make dep

jk is linked against v8worker2. As building V8 takes ~30 minutes, prebuilt versions are provided for linux/amd64 and darwin/amd64. This also includes flatc from flatbuffers:

# download the prebuilt artifacts from GitHub:
$ git clone https://github.com/jkcfg/prebuilt.git
$ cd ./prebuilt

# these following put files in /usr/local, so you may need sudo

# x64 Linux:
$ make install-linux-amd64

# x64 macOS:
$ make install-darwin-amd64

Building

After setting up the environment, the jk binary can be built:

$ make jk
$ ./jk --help # confirm it works

Additionally, on Linux, it's possible to use a docker container to build the project instead of installing the prebuilt libraries and binaries:

$ ./run-in-docker.sh make dep jk