Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@inlang/cross-sell-sherlock

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inlang/cross-sell-sherlock

A package to cross-sell Sherlock

  • 0.0.3
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

Cross-sell Sherlock package

Features

  • Check for Existing Recommendations: Quickly verify if an extension is already recommended in the workspace's .vscode/extensions.json file.
  • Add New Recommendations: Automatically add new recommendations to the .vscode/extensions.json file if they are not already present.

Installation

Put this one into your dependencies in package.json & install it with pnpm install:

"@inlang/cross-sell-sherlock": "workspace:*"

Usage

The module exports two main asynchronous functions:

isAdopted(fs: NodeishFilesystem, workingDirectory?: string): Promise<boolean>

Checks whether the inlang.vs-code-extension is recommended in the workspace.

Parameters
  • fs: A NodeishFilesystem object to interact with the file system.
  • workingDirectory: (Optional) The working directory path.
Returns
  • Promise<boolean>: true if the extension is recommended, false otherwise.

add(fs: NodeishFilesystem, workingDirectory?: string): Promise<void>

Adds the inlang.vs-code-extension recommendation to the workspace if it's not already present.

Parameters
  • fs: A NodeishFilesystem object to interact with the file system.
  • workingDirectory: (Optional) The working directory path.

Example

import { isAdopted, add } from '@inlang/cross-sell-sherlock';
import { NodeishFilesystem } from '@lix-js/fs';

async function addSherlock(fs: NodeishFilesystem) {
  const isExtensionAdopted = await isAdopted(fs);

  if (!isExtensionAdopted) {
    // prompt for user confirmation
    const userConfirmed = await promptUser();

    if (userConfirmed) {
      await add(fs);
      console.log('Extension recommendation added.');
    } else {
      console.log('User declined to add extension recommendation.');
    }
  }
}

Contributing

Contributions are welcome! If you have a feature request, bug report, or proposal, please open an issue or submit a pull request. Our Discord can be found here.

FAQs

Package last updated on 18 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc