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

@cogent-labs/prco-text

v1.0.10

Published

prco-text SMS inbound/outbound messaging.

Downloads

5

Readme

PRCO TEXT

prco-text SMS inbound/outbound messaging.

FEATURES AND COMPONENTS

prco-text features:

  • inbound and outbound messaging
  • subscribe/unsubscribe with custom opt-in, opt-out, help wording.
  • incoming message custom reply
  • incoming message log

prco-text components:

  • prco-text command line interface for easy control
  • prco-text server for communicating with twilio

Prerequisites

Node is required to use this module. Here is the best way to install Node:

install xcode if needed

    xcode-select --install

        click install button if it appears
        click agree button if it appears

create .bash_profile if needed

    NOTE: if macos catilana or newer then use ~/.zshrc instead of ~/.bash_profile below

    touch ~/.bash_profile

Install nvm

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

    source ~/.bash_profile

install node

nvm install 12

INSTALLATION

INSTALL

    npm install -g @cogent-labs/prco-text

UPGRADE

    npm upgrade -g @cogent-labs/prco-text

CHECK VERSION

    npm -g ls --depth 0

USAGE

USAGE

    prco-text

        OPTIONS

        --start-server                  start prco-text server
        --stop-server                   stop prco-text server
        --config-service-name           create twilio messaging service
        --config-service-phone-number   add phone number to twilio messaging service
        --outbound-message              message to send
        --target-phone-number           target phone number to send to
        --get-incoming-messages         get incoming messages log
        --clear-incoming-messages       clear incoming messages log


ONE TIME SETUP

    NOTE: prco-text server must be publicly accessible

    MAKE ENV FILE IF NECESSARY

        mkdir ~/protected
        touch ~/protected/prco-text-env

        EXAMPLE ~/protected/prco-text-env

            # PRCO TEXT CONFIG
            twilioAccountSid=xxxxxxxxxxx
            twilioAuthToken=xxxxxxxxxxx
            twilioServiceSid=xxxxxxxxxxx
            twilioPhoneNumberSid=xxxxxxxxxxx
            twilioIncomingMessageResponse="Yo! PRCO got your message."

    NAVIGATING TO TWILIO CONSOLE LOCATIONS
        TWILIO -- www.twilio.com
        CONSOLE_DASHBOARD -- console button
        CONSOLE_SERVICES -- CONSOLE_DASHBOARD > chat icon > messaging services
        CONSOLE_SERVICE -- CONSOLE_DASHBOARD > chat icon > messaging services > (service-name)
        CONSOLE_SERVICE_NUMBER -- CONSOLE_DASHBOARD > chat icon > messaging service > service-name > sender-pool > number
        CONSOLE_SERVICE_OPT_OUT -- CONSOLE_DASHBOARD > chat icon > messaging service > service-name > Opt-Out Management
        CONSOLE_SERVICE_WEBHOOK -- CONSOLE_DASHBOARD > chat icon > messaging service > service-name > Integration
        CONSOLE_VERIFIED_CALLER_IDS -- CONSOLE_DASHBOARD > elipsis icon > # phone numbers > Verified Caller IDs





    SETUP PROCESS
        purchase Twilio account with an SMS capable number
        use twilio-site to update env file: twilioAccountSid, twilioAuthToken, twilioPhoneNumberSid
            -- CONSOLE_DASHBOARD: twilioAccountSid, twilioAuthToken
            -- CONSOLE_SERVICE_NUMBER: twilioPhoneNumberSid
        use twilio-site to configure opt-in, opt-out, and help custom messages
            -- CONSOLE_SERVICE_OPT_OUT: click the edit link
        use twilio-site to configure webhook url
            -- CONSOLE_SERVICE_WEBHOOK
                -- under incoming messages, send-a-webhook
                -- enter publicly accessible url with sms endpoint-- example: https://898e6154fc66.ngrok.io/sms
        use prco-text to start server
        use prco-text to configure service name and collect twilioServiceSid
        add twilioServiceSid to env file
        use prco-text stop then start server
        use prco-text to configure service phone number


    HOW TO USE NGROK TO PROVIDE PUBLIC URL
        NOTE: this is for demo purposes
        create ngrok account
        killall ngrok
        ngrok http 1337
        note public url -- __ngrok-url__ + `/sms`
        update twilio messaging service -- integration
                Send a webhook
                Request URL:  https://ee2bf9ff5ecb.ngrok.io/sms     // example url
                HTTP Post

EXAMPLES

    START SERVER

        prco-text --start-server


    STOP SERVER

        prco-text --stop-server


    CONFIGURE SERVICE NAME

        prco-text --config-service-name "PRCO MESSAGING SERVICE"


    CONFIGURE SERVICE PHONE NUMBER

        prco-text --config-service-phone-number


    SEND TEXT MESSAGE

        prco-text --outbound-message "Your inspection request is ready" \
            --source-phone-number +19252582639   \
            --target-phone-number +14158761234


    GET INCOMING TEXT MESSAGES

        prco-text --get-incoming-messages


    CLEAR INCOMING TEXT MESSAGES

        prco-text --clear-incoming-messages