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

beesy

v1.1.1

Published

a wonderful package meant to simplify back-end programming.

Downloads

1

Readme

beesy

a wonderful package meant to simplify backend programming.


features

  • easy file operations: simplify file reading, writing, and editing with ease.
  • effortless email delivery: send emails seamlessly with just a few lines of code.

installation

npm install beesy

usage

read(filelocation, filename, encodingtype)

this function reads the content of a file synchronously.

parameters

  • filelocation: the directory where the file is located.
  • filename: the name of the file to be read.
  • encodingtype: the encoding type to be used for reading the file (e.g., 'utf8').

returns

  • if successful, the function returns the content of the file.
  • if an error occurs during file reading, the function logs the error to the console, prints an error message, and returns null.

example

const filecontent = read('/path/to/directory', 'example.txt', 'utf8');
console.log(filecontent);

write(filelocation, filename, content)

this function writes content to a file asynchronously.

parameters

  • filelocation: the directory where the file should be written.
  • filename: the name of the file to be created or overwritten.
  • content: the content to be written to the file.

process

  1. the function appends an empty string to the specified file to create it if it doesn't exist.
  2. it then writes the provided content to the file.

throws

  • if an error occurs during file writing, an error is thrown.

example

write('/path/to/directory', 'newfile.txt', 'hello, beesy!');

edit(filelocation, filename, content)

this function appends content to an existing file asynchronously.

parameters

  • filelocation: the directory where the file is located.
  • filename: the name of the file to which content will be appended.
  • content: the content to append to the file.

process

  1. the function constructs the full path to the file using the provided filelocation and filename.
  2. it then appends the specified content to the file.
  3. if an error occurs during the operation, it is logged to the console, and an error is thrown.

throws

  • if an error occurs during file appending, an error is thrown.

example

edit('/path/to/directory', 'existingfile.txt', 'new content appended.');

email(senderemail, senderpassword, sendername, recipientemail, emailsubject, emailhtmllocation);

email("[email protected]", "examplepassword", "jane doe", "john doe", "subject line", path.join(__dirname, "/index.html"));

this function facilitates the sending of emails using the specified email configuration.

parameters

  • senderemail: the email address of the sender.
  • senderpassword: the password for the sender's email account.
  • sendername: the name of the sender.
  • recipientemail: the email address of the recipient.
  • emailsubject: the subject of the email.
  • emailhtmllocation: the file location of the html content for the email.

process

  1. the function constructs an email configuration object based on the provided sender's information, recipient's information, and email content.

email configuration

known email servers (gmail, outlook, aol, yahoo, etc.)

  • simpleserver(senderemailservice)

    simpleserver('outlook');
    sendemail();

example

// declare the mail variable
const mail = beesy.email(
  "[email protected]",
  "password123",
  "jane doe",
  "[email protected]",
  "this is an email sent with beesy!",
  path.join(__dirname, "/index.html")
);
// set custom server configuration
mail.simpleserver('outlook');

// send the email
mail.sendemail();

unknown email servers (personally hosted servers, personal domain servers, etc.)

  • customserver(hostname, port, secure)

    customserver(smtp.myserver.com, 465, true);

sending the email

  • sendemail();

    sendemail();

example

// declare the mail variable
const mail = beesy.email(
  "[email protected]",
  "password123",
  "jane doe",
  "[email protected]",
  "this is an email sent with beesy!",
  path.join(__dirname, "/index.html")
);
// set custom server configuration
mail.customserver('smtp.myserver.com', 465, true);

// send the email
mail.sendemail();

fyi

  • it is heavily advised that you do not explicitly put your passwords onto any javascript files. instead, please utilize the dot env package.
credit

package by: lola raji

created on: 26 december 2023