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

chimplist

v1.0.4

Published

Wrapper for Mailchimp's API v3 to manage Lists/Audiences and List Members.

Downloads

57

Readme

chimplist

Chimplist makes it very easy and simple to work with Mailchimp's API v3 to manage your Lists(also called Audiences) and their Members.

How to install?

npm install chimplist

How to use Chimplist?

*ES6 Syntax

const Chimplist = require("chimplist");

const API_KEY = "your Mailchimp API KEY";

const Chimp = new Chimplist(API_KEY);

/* Using `getAllLists()` function to get information about all lists
 * All the available functions with Chimplist are mentioned down below.
 * This is how you would work with the new ES6 promise syntax with .then .catch */
Chimp.getAllLists()
  .then((response) => {
    // Work with the `response` from Mailchimp API
    // `response` is a standard HTTP response(Headers, Body, etc).
  })
  .catch((error) => {
    // Handle any errors while running `getAllLists()`
  });

// You can use async/await inside try/catch block as well
const functionName = async () => {
  try {
    const response = await Chimp.getAllLists();
    // Work with the `response` from Mailchimp API
  } catch (error) {
    // Handle any errors while running `getAllLists()`
  }
};

// Call the function to execute the try/catch block code
functionName();

Why Chimplist?

A lot of people use Mailchimp for their list feature. Chimplist aims at the people who quickly just want to add a sign up to newsletter type of form to their website. This library aims to help them get started working with Mailchimp lists with ease and simplicity by making sure:

  • You don't have to worry about the Mailchimp's API end points.
  • You don't have to worry about handling authorizations.
  • You don't have to worry about knowing how to make HTTP requests.
  • You can use it on your back-end with just few lines of code.

Note: At the moment, Chimplist do not support the capability to apply request query parameters to your API requests for keeping things simple. Maybe in the future that feature might be added, untill then you might like using something like node-mailchimp.

Chimplist's Functions Guide

list_id - The list id(also known as Audience ID) of the specific list you are targeting. Can be found in Audience -> Settings -> Audience name and campaign defaults. Data type is string.

options - The data object which contains at least the required request body parameters. Reference links are provided down below along with those specific functions. Data type is object.

subscriber_hash - According to Mailchimp API documentation: "it is The MD5 hash of the lowercase version of the list member's email address". But it's basically the id of the member. It looks like 5adgf4de580e68d565db69db203a5c88. Data type is string.

LIST Functions

  • createList(options) - Create a new list

    options -> to learn more about what options should contain, refer to mailchimp api documentaion here.

  • getAllLists() - Get information about all lists in the account.

  • getList(list_id) - Get information about a specific list.

  • updateList(list_id, options) - Update a specific list

    options -> To learn more about what options should contain, refer to Mailchimp API Documentaion here.

  • deleteList(list_id) - Delete a specific list

MEMBER Functions

  • addMember(list_id, options) - Add a new list member

    options -> to learn more about what options should contain, refer to mailchimp api documentaion here.

  • getAllMembers(list_id) - Get information about members in a list

  • getMember(list_id, subscriber_hash) - Get information about a specific list memeber.

  • updateMember(list_id, subscriber_hash, options) - Update a specific list memeber.

    options -> to learn more about what options should contain, refer to mailchimp api documentaion here.

  • archiveMember(list_id, subscriber_hash) - Archive a list memeber.

  • deleteMember(list_id, subscriber_hash) - Permanently delete a list member.