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

sc-datatem

v0.0.8

Published

A TypeScript library for data template operations

Readme

sc-datatem

npm version TypeScript License: MIT

A TypeScript library for integrating with the Datatem API, providing easy access to SIM card management and M2M/IoT connectivity services.

🚀 Installation

npm install sc-datatem

✨ Features

  • JWT Authentication - Automatic login and token management
  • SIM Card Management - List and query SIM card details
  • Automatic Token Handling - Axios interceptors for seamless authentication
  • Error Handling - Comprehensive API error management
  • TypeScript Support - Full type definitions and IntelliSense
  • Production Ready - Tested with real Datatem API credentials

📚 Quick Start

Basic Usage

import { ScDatatem } from "sc-datatem";

async function main() {
  try {
    // Create and authenticate in one step
    const datatem = await ScDatatem.create({
      email: "[email protected]",
      password: "your-password",
    });

    // Get all SIM cards
    const simCards = await datatem.getSimCards();
    console.log(`Found ${simCards.length} SIM cards`);

    // Filter active SIM cards
    const activeCards = simCards.filter((sim) => sim.status === "ACTIVE");
    console.log(`Active cards: ${activeCards.length}`);

    // Check authentication status
    console.log(`Authenticated: ${datatem.isAuthenticated()}`);

    // Logout when done
    datatem.logout();
  } catch (error) {
    console.error("Error:", error.message);
  }
}

main();

Manual Instantiation

import { ScDatatem } from "sc-datatem";

const datatem = new ScDatatem({
  email: "[email protected]",
  password: "your-password",
});

// Authentication is handled automatically in the constructor
const simCards = await datatem.getSimCards();

🔧 Development with npm link

To use this library locally in another project:

# In this library directory
npm run build
npm link

# In your project directory
npm link sc-datatem

Then import normally:

import { ScDatatem } from "sc-datatem";

Any changes you make to this library will be reflected in your project after running npm run build.

📖 API Reference

ScDatatem Class

ScDatatem.create(loginData: LoginData): Promise<ScDatatem>

Static factory method that creates and authenticates an instance in one step.

new ScDatatem(loginData: LoginData)

Constructor that creates an instance and handles authentication automatically.

getSimCards(): Promise<SimCard[]>

Retrieves all SIM cards associated with the authenticated account.

isAuthenticated(): boolean

Returns whether the instance has a valid authentication token.

logout(): void

Clears the authentication token.

Types

type LoginData = {
  email: string;
  password: string;
};

type SimCardStatus = "ACTIVE" | "INACTIVE";

type SimCard = {
  phoneNumber: string;
  status: SimCardStatus;
  operator: string;
  connected: boolean;
  device: string;
  iccid: string;
  monthUsedData: number;
  monthUsedDataPct: number;
  // ... additional fields
};

type User = {
  id: string;
  name: string;
  email: string;
  document: string;
  role: string;
};

🛠️ Development

Scripts

npm run build        # Build the library
npm run dev          # Build in watch mode
npm run test         # Run tests
npm run lint         # Lint code
npm run format       # Format code

Testing

Set up your environment variables:

[email protected]
DATATEM_PASSWORD=your-password

Run tests:

npm test

📄 License

MIT

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🔗 Links