yahoo-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Yahoo.js - Javascript API for Yahoo

Yahoo.js is a typesafe api to get data from Yahoo. The only way to use is to add it into your google extension. It is lightweight and easy to use.

Installation

npm install yahoo-js

Add Into your Content Script

import $ from "jquery";
// @ts-ignore
import yahooJs, { api } from "yahoo-js";
yahooJs($);

Import JQuery and Yahoo.js. Pass jquery into yahoo.js, this will give it access to get the needed data.

Events

Email Item is a JQuery HTML Element

YAHOO_JS.on("clicked_email", (emailItem) => {
  console.log(emailItem);
});

YAHOO_JS.on("view_email", (emailItem) => {
  console.log(emailItem);
});

YAHOO_JS.on("compose_view", (emailItem) => {
  console.log(emailItem);
});

YAHOO_JS.on("compose_cancel", (emailItem) => {
  console.log(emailItem);
});

API

The methods inside of getEmailObj can also be imported like this

import yahooJs, {
  from,
  to,
  cc,
  bcc,
  subject,
  body,
  attachments,
} from "yahoo-js";
export const api = {
  /* Returns an object with the active compose email data */
  getEmailObj: () => {
    return {
      from: from(),
      to: to(),
      cc: cc(),
      bcc: bcc(),
      subject: subject(),
      body: body(),
      attachments: attachments(),
    };
  },
};

Contributing

Readme

Keywords

none

Package Sidebar

Install

npm i yahoo-js

Weekly Downloads

2

Version

1.0.7

License

ISC

Unpacked Size

3.87 MB

Total Files

39

Last publish

Collaborators

  • isaacjuracich