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

openafricadata-provost

v1.0.2

Published

Comprehensive error tracking for Node.js projects

Downloads

6

Readme

Provost

Comprehensive Error Tracking for Node.js Projects

Provost is a powerful error tracking tool designed to be easily integrated into Node.js applications, including Express.js, NestJS, React, React Native, and Koa.js. It captures errors, gathers additional system and browser information, and sends the error data to a specified API endpoint for tracking and analysis.

Table of Contents

Installation

To install Provost, use npm or yarn:

npm install provost

or

yarn add provost Usage Basic Setup To start using Provost, you need to initialize it once in your application with your API key and application ID.

javascript

import { Provost, ErrorPriority } from 'provost';

// Initialize Provost
const provost = new Provost({
  apiKey: 'your-api-key',
  appId: 'your-app-id',
});
provost.start();
Using with Express.js
javascript
Copy code
import express from 'express';
import { Provost, ErrorPriority } from 'provost';

const app = express();

// Initialize Provost
const provost = new Provost({
  apiKey: 'your-api-key',
  appId: 'your-app-id',
});
provost.start();

app.use((err, req, res, next) => {
  provost.logError(err, ErrorPriority.High);
  res.status(500).send('Something broke!');
});

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Using with NestJS typescript

import { Injectable, NestMiddleware } from '@nestjs/common';
import { Provost, ErrorPriority } from 'provost';

const provost = new Provost({
apiKey: 'your-api-key',
appId: 'your-app-id',
});
provost.start();

@Injectable()
export class ErrorLoggingMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: Function) {
try {
next();
} catch (error) {
provost.logError(error, ErrorPriority.High);
next(error);
}
}
}

Using with React javascript

import React, { Component } from 'react';
import { Provost, ErrorPriority } from 'provost';

const provost = new Provost({
apiKey: 'your-api-key',
appId: 'your-app-id',
});
provost.start();

class App extends Component {
componentDidCatch(error, info) {
provost.logError(error, ErrorPriority.Critical);
}

render() {
return (
<div>
<h1>My React App</h1>
</div>
);
}
}

export default App;

Using with React Native javascript

import React, { Component } from 'react';
import { Provost, ErrorPriority } from 'provost';

const provost = new Provost({
apiKey: 'your-api-key',
appId: 'your-app-id',
});
provost.start();

class App extends Component {
componentDidCatch(error, info) {
provost.logError(error, ErrorPriority.Critical);
}

render() {
return (
<View>
<Text>My React Native App</Text>
</View>
);
}


export default App;

Configuration Provost requires the following configuration options:

apiKey: Your API key for authentication. appId: Your application ID. apiUrl: The URL to send error reports to. Example Configuration javascript Copy code const provost = new Provost({ apiKey: 'your-api-key', appId: 'your-app-id', }); Error Handling Provost captures and logs errors, including uncaught exceptions. You can also log errors manually using the logError method.

javascript Copy code try { // Your code here } catch (error) { provost.logError(error, ErrorPriority.High); }

API Reference Provost Class constructor(config: ProvostConfig) Initializes a new instance of Provost with the provided configuration.

logError(error: Error, priority?: ErrorPriority): void Logs an error with the specified priority.

Contributing Contributions are welcome! Please submit a pull request or open an issue to discuss your changes.

License Provost is licensed under the MIT License. See the LICENSE file for more details.

perl Copy code

This README.md provides clear instructions on how to install, configure, and use the provost package, along with examples for different frameworks. It also explains the main features and provides an API reference.