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

@ikonintegration/ikapi

v4.0.0-alpha20

Published

Ikon nodejs API foundation

Downloads

1,167

Readme

IKApi Node.js Package

Ikon nodejs API foundation

Overall

  • npm npm npm (tag) Libraries.io dependency status for latest release, scoped npm package
  • GitHub commit activity
  • GitHub last commit

Samples

  • Router
import * as Config from './routes/tenant/config.js';

const routes = [
  { route: '/tenant/config', method: 'GET', handler: Config.get },
];
//Main handler
export const handler = async (event, context) => {
  (await (new IKAPI.IKRouter(routes, {
    database: {
      type: 'DDB | SQL', -- fallback to DDB if not set
      //DDB Specific
      region: IBEWCoreGlobals.DatabaseRegion,
      tableName: IBEWCoreGlobals.DatabaseTableName,
      //SQL Specific
      host: '127.0.0.1', database: 'DB',
      port: 3307, user: 'root', password: 'IDK'
    },
    //Cache
    cache: {
      type: 'REDIS',
      host: '127.0.0.1',
      password: '22P',
      user: '22U',
      enableTLS: true,
    },
    //IKValidator
    validation: {
      additionalTypes: { TYPE: (val) => { return validate(val); } }
    },
    //Logger
    logger: {
      //takes precende over process.env.LOG_LEVEL
      level: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR',
      enableSensitiveFiltering: false, //defaults to false
      sensitiveFilteringKeywords: [], //replaced default blacklist set
    },
    //Queue
    publisher: { region: 'SNS-REGION' },
    //Resources tracker
    resourcesTracker: { //by default, it will auto track (lambda, ecs, ddb)
      busName: 'busName',
      region: 'region',
      appName: 'appName',
    }
  };)).handleEvent(event, context));
}
```

- Mailer

```
const mailer = new IKAPI.IKMailer(LMCoreGlobals.SESSender, LMCoreGlobals.SESRegion);
```

- Process

```
export const main = async () => {
  const interval = (Docket.Globals.ExtractorPollerInterval * 1000);
  console.debug('Using interval of', interval);
  //init authorization
  await (new Docket.Core({},  Docket.Globals.AccessLevel.ANY)).authenticate(async (core) => {
    await (new IKAPI.IKProcess(Docket.Globals.API_Config, interval)).execute( async (process) => {
      await pull(core);
    });
  });
};
```

- Event Process (Queue/SQS)

```
//Main handler
export const handler = async (event, context) => {
  //Start event processor, if any event failed, execution will stop!
  await (new IKAPI.IKEventProcessor(event, context, Docket.Globals.API_Config)).processEvent( async (transaction, recordContent) => {
    //init authorization
    return await (new Docket.Core(transaction,  Docket.Globals.AccessLevel.ANY)).authenticate(async (core) => {
      core.queue.publishOnTopic(event, Docket.Globals.SNSTopic_ExtractorNotification);
      return IKAPI.IKSuccessResponse();
    });
  });
};
```

- Transaction

```
//Main handler
export const handler = async (event, context) => {
  //Start event processor, if any event failed, execution will stop!
  await (new IKAPI.IKTransaction(event, context, Docket.Globals.API_Config)).execute( async (transaction) => {
    //init authorization
    return await (new Docket.Core(transaction,  Docket.Globals.AccessLevel.ANY)).authenticate(async (core) => {
      const queue = event.queue;
      //Get from specified queue
      if (!queue) throw new Error(`Empty queue URL! - ${queue}`);
      //Success :)
      return IKAPI.IKSuccessResponse();
    });
  });
};
```

- Dynamo Streams

```
//Main handler
export const handler = async (event, context) => {
  //Start event processor, if any event failed, execution will stop!
  await (new IKAPI.IKDynamoStream(event, context, Docket.Globals.API_Config)).processEvent( async (transaction, recordContent) => {
    //Check if is deletion
    if (!_isDynamoDeletion(recordContent)) return (new IKAPI.IKSuccessNoContentResponse());
    //init authorization
    return await (new Docket.Core(transaction,  Docket.Globals.AccessLevel.ANY)).authenticate(async (core) => {
      return IKAPI.IKSuccessResponse();
    });
  });
};
```