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

@aac/directory

v1.4.7

Published

Directory ClientReach

Downloads

979

Readme

Directory ClientReach

Add this package to your project: npm i @aac/directory

I recommend adding a helper function in your project so that you don't pass configuration everytime you use the function. Configure the directory:

const {Directory} = require('@aac/directory');

const directory = (props = {query: ''}) => {
    const {query = {}} = props;
    return new Directory({
        credentials: {
            api: CLIENTREACH_API_URL,
            username: CLIENTREACH_API_USERNAME,
            password: CLIENTREACH_API_PASSWORD,
        },
        specialty: 'addiction-treatment',
        listings_path: 'local',
        listings_path_use_hierarchical: false,
        facilities_path: 'listings',
        site_name: 'Project Know',
        phone: '',
        query,
    });
};

Directory Parameters:

| Parameter | Descriptions | Default | |-----------------|---------------|------:| | pluginPath. | | null | | seed | Used for generating the facility profile unique ID in the URL for facility pages. Ex: EX: /listings/greenhouse-treatment-center-1868084797 Rehabs (2), Recovery (3), Detox (3) | 2 | | specialty | Used for filtering free posts by specialty. projectknow, detox, drugabuse, recovery, rehab | 'rehab' | | listings_path | Used for generating the state/city url path. State example: /local/california City example: /local/los-angeles-ca | 'local' | | listings_path_use_hierarchical | Indicator for generating hierarchical state/city url path. State example: /local/california City example: /local/california/los-angeles | false | | facilities_path | Used for generating the facility profile url path. EX: /listings/ greenhouse-treatment-center-1868084797 | 'listings' | | aac_account_id | Used in functions that determine/validate if a facility is AAC or not. There are business compliance cases where we cannot show some data on non-aac facilities. | 'cuJjm8Z5' | | credentials | This object is passed to the ClientReach Class which handles authenticated requests. {username: '', password: ''} | null | | site_name | There are helper functions that have output including the site name. | null | | phone | Each directory has a unique CallRail Phone number associated with it. | null | | query | Currently there are helper functions that determine page type based on query parameters, pass the Express context.query if you need those functions. See Directory.getVars for the list of accepted parameters | {} |

Gotchas

  • This package uses the format: 'legacy' header on all GET and POST requests. This can debugging issues when issues postman if this header isn't set. This format was originally chosen because the response size is drastically smaller. Those headers can be found here.

  • This project requires Node version 14

nvm use 14

Publishing Beta Version (for QA on staging sites)

You must be logged in via CLI (npm login), and be listed as a collaborator here

  1. npm run build - build files are committed here
  2. npm version x.x.x-beta.x - increase using semantic versioning
    • It is crucial that we add beta.0 at the end of your version. The .0 indicates which beta version it is. When we publish a new fix as beta, we will increment the .0 to .1 and so on.
  3. npm publish --tag beta
  4. Confirm version on npm page

Publishing

You must be logged in via CLI (npm login), and be listed as a collaborator here

  1. npm run build - build files are committed here
  2. Merge pull request into master
  3. npm version x.x.x - increase using semantic versioning
  4. npm publish
  5. Confirm version on npm page