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

@fnet/edge-profiles

v0.1.6

Published

## Introduction

Downloads

12

Readme

@fnet/edge-profiles

Introduction

The @fnet/edge-profiles project is a simple utility designed to help users easily retrieve the names of user profiles from the Microsoft Edge browser. By accessing and reading the 'Local State' file within Edge's user data directory, this utility simplifies the task of identifying different user profiles set up in the browser. This can be particularly useful for users who need to manage or differentiate between multiple profiles on a single system.

How It Works

The tool operates by locating the Edge browser's user data directory either through a specified path or by using the default path based on the operating system. It then reads the 'Local State' file found within this directory and extracts the names of the profiles listed within the browser. The utility returns these profile names, providing an insight into the various user profiles configured in Edge.

Key Features

  • Platform-Aware: Automatically determines the standard user data path for Edge, depending on whether you're using Windows, macOS, or Linux.
  • Profile Listing: Reads the necessary configuration file and lists all the user profile names associated with the Edge browser installation.
  • Error Handling: Provides feedback if it fails to read the profiles, helping users diagnose issues related to path or permission errors.

Conclusion

@fnet/edge-profiles is a straightforward utility for users who need to identify and work with multiple user profiles in Microsoft Edge. By automating the process of reading and listing these profiles, it simplifies the task, making it hassle-free to manage user data configurations.

Developer Guide for @fnet/edge-profiles

Overview

The @fnet/edge-profiles library provides a straightforward way to access and enumerate user profiles from the Edge browser. This library focuses on extracting profile information such as profile names and directory paths from the browser's local data. It is useful for developers who need to programmatically interact with or manage Edge browser profiles.

Installation

To install the @fnet/edge-profiles library, you can use either npm or yarn. Run one of the following commands in your project's root directory:

Using npm:

npm install @fnet/edge-profiles

Using yarn:

yarn add @fnet/edge-profiles

Usage

Below is a guide on how to use the @fnet/edge-profiles library to list Edge browser user profiles. The core function provided by this library is the default export, which allows you to retrieve browser profile information.

List Edge Browser Profiles

You can use the default function from the library to get a list of Edge browser profiles. It returns a promise that resolves to an array of objects, each containing the name and directory of a profile.

import edgeProfiles from '@fnet/edge-profiles';

// Calling the function without arguments to use the default path
edgeProfiles()
  .then(profiles => {
    profiles.forEach(profile => {
      console.log(`Profile Name: ${profile.name}, Profile Directory: ${profile.dir}`);
    });
  })
  .catch(err => {
    console.error('Error retrieving profiles:', err.message);
  });

If you want to specify a custom path to the Edge user data directory, you can pass an object with an edgeDataPath property:

import edgeProfiles from '@fnet/edge-profiles';

const customPath = '/path/to/custom/edge/user/data';

edgeProfiles({ edgeDataPath: customPath })
  .then(profiles => {
    profiles.forEach(profile => {
      console.log(`Profile Name: ${profile.name}, Profile Directory: ${profile.dir}`);
    });
  })
  .catch(err => {
    console.error('Error retrieving profiles:', err.message);
  });

Examples

Here are some scenarios where this library can be particularly useful:

Example 1: List Default Profiles

This example shows how to list all the user profiles stored in the default Edge user data directory.

import edgeProfiles from '@fnet/edge-profiles';

edgeProfiles().then(profiles => {
  console.log('Edge Profiles:', profiles);
}).catch(console.error);

Example 2: List Profiles from a Custom Path

Sometimes the user data may not be located in the default directory. In such cases, you can specify the path to the data.

import edgeProfiles from '@fnet/edge-profiles';

edgeProfiles({ edgeDataPath: '/custom-path' })
  .then(profiles => {
    console.log('Custom Path Edge Profiles:', profiles);
  })
  .catch(console.error);

Acknowledgement

This project appreciates the effort and contributions of developers and contributors of the libraries and tools that @fnet/edge-profiles depends on. Their work has been instrumental in making this library functional and reliable.

Input Schema

$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
  edgeDataPath:
    type: string
    description: Optional. The path to the Edge's user data directory. Defaults to
      the standard path on the current operating system if not provided.
required: []