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 🙏

© 2026 – Pkg Stats / Ryan Hefner

codeapp-js

v0.2.2

Published

JavaScript library with samples and starter app for Power Apps Code Apps.

Readme

CodeApp js

A simplified JavaScript version of Microsofts Power Apps Code Apps. The project using the @microsoft/power-apps/data SDK. It includes generated Dataverse services and connector libraries for Outlook, SharePoint, Office 365 Groups, and Office 365 Users (more to follow soon).


Project Structure

dist/
  codeapp.js            # bridging functions to the sdk
  power-apps-data.js    # JavaScript version of SDK
  index.js              # Custom JavaScript for your app
  index.html            # Web page for App
src/
  generated/           # Auto-generated connection services & models
    services/
      AccountsService.ts
    models/
      AccountsModel.ts
      CommonModels.ts
power.config.json      # App configuration, connections, and data sources

Requirements

  • Microsoft Power Platform CLI (pac) must be installed before using this project.
  • Node.js and npm must be installed to use the local npm workflow.
  • Verify the CLI is available by running pac or Get-Command pac | Format-List in PowerShell.

npm Setup

From the repository root:

npm install

This installs the npm dependencies and rebuilds every local power-apps-data.js file from the published @microsoft/power-apps package so the samples stay in sync with npm.

To serve the repository locally:

npm start

The server runs from the repo root on port 4173, so you can open any sample directly, for example:

  • http://localhost:4173/codeApp/dist/
  • http://localhost:4173/examples/todo/dist/
  • http://localhost:4173/examples/outlook%20Demo/dist/

To jump straight to the starter app:

npm run start:codeapp

CLI Commands

# Authenticate and create a local auth profile
pac auth create

# Authenticate directly to a specific environment
pac auth create --environment "<environment-id-or-url>"

# List saved auth profiles
pac auth list

# Select the active environment for the current auth profile
pac env select --environment "<environment-id-or-url>"

# List Dataverse connections in the selected environment
pac connection list

# Create a Dataverse connection
pac connection create --name "<connection-name>" --application-id "<app-id>" --client-secret "<client-secret>" --tenant-id "<tenant-id>"

# Add datasource files
pac code add-data-source -a "<connection-name>" -c "<connection-id"

# Push the app to your Power Platform environment
pac code push --solutionName <YourSolutionName>

Configuring power.config.json

Adding a Dataverse Table

To add a new Dataverse table (e.g. contacts), add an entry under databaseReferences.default.cds.dataSources:

{
  // ... other config ...
  "databaseReferences": {
    "default.cds": {
      "dataSources": {
        "accounts": {
          "entitySetName": "accounts",
          "logicalName": "account"
        },
        "contacts": {
          "entitySetName": "contacts",
          "logicalName": "contact"
        }
      },
      "environmentVariableName": ""
    }
  }
}

After adding the table, run pac code push — the SDK will auto-generate a service class (like AccountsService) that you can import and use.

Adding a Connection Reference

Each connector library needs a matching entry in connectionReferences.

{
  "connectionReferences": {
    // Dataverse
    "Dataverse": {
      "id": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
      "displayName": "Microsoft Dataverse",
      "dataSources": ["commondataserviceforapps"],
      "dataSets": {}
    },
    
    // Office 365 Outlook  (used by dist/outlook.js)
    "office365outlook": {
      "id": "/providers/Microsoft.PowerApps/apis/shared_office365",
      "displayName": "Office 365 Outlook",
      "dataSources": ["office365"],
      "dataSets": {}
    },
    // SharePoint Online  (used by dist/sharepoint.js)
    "sharepointonline": {
      "id": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
      "displayName": "SharePoint",
      "dataSources": ["sharepointonline"],
      "dataSets": {}
    },
    // Office 365 Groups  (used by dist/office365groups.js)
    "office365groups": {
      "id": "/providers/Microsoft.PowerApps/apis/shared_office365groups",
      "displayName": "Office 365 Groups",
      "dataSources": ["office365groups"],
      "dataSets": {}
    },
    // Office 365 Users  (used by dist/office365users.js)
    "office365users": {
      "id": "/providers/Microsoft.PowerApps/apis/shared_office365users",
      "displayName": "Office 365 Users",
      "dataSources": ["office365users"],
      "dataSets": {}
    }
  }
}