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

mender

v0.0.6

Published

Mender SDK for JavaScript

Downloads

10

Readme

Mender SDK for JavaScript

Usage

import Mender from 'mender';

const mender = new Mender(process.env.MENDER_URL);

mender.login(username, password)
  .then(it => {
    console.log(it);
  }, e => {
    console.error(e);
  });

Docs

  • https://docs.mender.io/1.6/apis
  • Mender Device Authentication Service
  • Mender Deployment Service: https://github.com/mendersoftware/deployments
  • Mender Device Inventory Service:
    • https://github.com/mendersoftware/inventory
    • https://github.com/mendersoftware/deviceadm
  • Mender User Administration Service: https://github.com/mendersoftware/useradm
  • Mender API Gateway
  • Minio object storage
  • Storage service proxy based on OpenResty

Code Generating From swagger

yarn add -d swagger-codegen-axios-flow
yarn run swagger-codegen-axios-flow < docs/_data/inventory.json > docs/_data/inventory.js

ref. https://github.com/yongjhih/swagger-codegen-axios-flow

Installation

yarn add mender

for latest version:

yarn add git+ssh://[email protected]/yongjhih/mender.js.git#dist

and also you can install specific commit of dist:

yarn add git+ssh://[email protected]/yongjhih/mender.js.git#<commit-id>

Development

  • Please deploy after implemented feature

Deployment

  • git checkout dist && git merge master
  • yarn deploy

Testing and coverage

yarn build && yarn test && yarn coverage

You can open flow-coverage/ and coverage/lcov-report to see

Requirements

  • node
  • yarn
brew install node yarn

Build

p.s. We used babel as default compiler before, you can also use flow-remove-types

yarn build && yarn test

Type checking with flow

yarn run flow

You should install a flow plugin on your IDE instead.

API Documentation

yarn docs

You can open docs/ to see

Stack

  • ES6

  • Functional

  • Promise

  • Type-safety

  • Null-safety

  • Generic

  • Unit testable / coverage report

  • package manager: yarn (~~npm~~)

  • http client: axios (~~request~~, ~~node-fetch~~)

  • static type checking: facebook/flow (~~Microsoft/TypeScript~~, ~~Google/Dart~~, ~~kotlin2javascript~~)

  • runtime type checking: codemix/flow-runtime (~~tcomb~~)

  • testing frameworks: jest (~~mocha~~, ~~karma~~, ~~jasmine~~)

  • mock web: nock

Why JavaScript+Flow

I considered that Python, KotlinScript, GoLang, JavaScript, Dart, TypeScript, JavaScript+Flow, Rust, Ruby, OCaml, ReasonML. I choose JavaScript+Flow, because it's type-safety, null-safety, supports generics and functional.

  • Flow: facebook/flow compile-time type checking system
  • +flow-runtime (relacement of ~~tcomb~~)

Python has PEP 484 decorator/annotation feature that could be able to do type checking But I realized that there is nobody care about that too much in the Python community. There is not too much activity.

And it shouldn't be as decorator for type checking, it should be real type/class for type checking with Generic and Null-Safety. Actually I really want to write KotlinScript, but it's not ready for our teammates.

Credit

  • The main class has been generated by https://github.com/yongjhih/swagger-codegen-axios-flow