New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mergent

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mergent

JavaScript library for the Mergent API. See https://mergent.co for details.

  • 1.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mergent JavaScript Library

npm version CI

The Mergent JavaScript library provides convenient access to the Mergent API from applications written in the JavaScript language.

Installation

Install the package with:

npm install mergent --save
# or
yarn add mergent

Usage

The library needs to be configured with your project's API key. Set Mergent.api_key to its value:

const Mergent = require("mergent");

// set the Mergent API key
const mergent = new Mergent("...");

// create a Task that will make an HTTP request in 5 minutes
mergent.tasks
  .create({
    request: { url: "...", body: "Hello, world!" },
    delay: { minutes: 5 },
  })
  .then((task) => console.log(task))
  .catch((error) => console.error(error));

// create a recurring Schedule that will make an HTTP request every minute
mergent.schedules
  .create({
    request: { url: "...", body: "Hello, world!" },
    cron: "* * * * *",
  })
  .then((task) => console.log(task))
  .catch((error) => console.error(error));

Usage with TypeScript

import Mergent from "mergent";

// set the Mergent API key
const mergent = new Mergent("...");

// create a Task that will make an HTTP request in 5 minutes
mergent.tasks
  .create({
    request: { url: "...", body: "Hello, world!" },
    delay: { minutes: 5 },
  })
  .then((task) => console.log(task))
  .catch((error) => console.error(error));

// create a recurring Schedule that will make an HTTP request every minute
mergent.schedules
  .create({
    request: { url: "...", body: "Hello, world!" },
    cron: "* * * * *",
  })
  .then((task) => console.log(task))
  .catch((error) => console.error(error));

See the Mergent JavaScript docs for more details.

Development

After checking out the repo, run npm install to install dependencies. Then, run npm test to run the tests.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mergentlabs/mergent-js.

Distributing

  1. Update the version with npm version <version> (this makes a new commit)
  2. Amend that commit with updates to the CHANGELOG
  3. Push with git push --tags
  4. Package with npm run package
  5. Publish with npm publish

License

The library is available as open source under the terms of the MIT License.

FAQs

Package last updated on 29 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc