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

@inlang/cross-sell-ninja

Package Overview
Dependencies
Maintainers
0
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inlang/cross-sell-ninja

A package to cross-sell Ninja

  • 0.0.34
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
0
Weekly downloads
 
Created
Source

Cross-sell Ninja 🥷 package

Features

  • Workflow Verification: Ensures that the GitHub Actions workflow incorporating the Ninja i18n lint action is present in a project's .github/workflows directory.
  • Automated Workflow Addition: If not present, the package can automatically add a workflow to incorporate Ninja i18n linting into the project.

Installation

Add this package to your dependencies in package.json & install it using pnpm install:

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

Usage

This module exports two main asynchronous functions:

isAdopted(fs: NodeishFilesystem): Promise<boolean>

Verifies if the Ninja i18n GitHub Action is adopted within the GitHub workflow files of your project.

Parameters
  • fs: A NodeishFilesystem object for file system interactions.
Returns
  • Promise<boolean>: true if the Ninja i18n GitHub Action workflow is found, false otherwise.

add(fs: NodeishFilesystem): Promise<void>

Adds the Ninja i18n GitHub Action workflow to the repository's .github/workflows directory if it's not already present.

Parameters
  • fs: A NodeishFilesystem object for file system interactions.

Example

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

async function ensureNinjaAdoption(fs: NodeishFilesystem) {
  const isWorkflowAdopted = await isAdopted(fs);

  if (!isWorkflowAdopted) {
    // Optionally prompt for user confirmation
    const userConfirmed = await promptUser("Do you want to add the Ninja i18n workflow?");

    if (userConfirmed) {
      await add(fs);
      console.log('Ninja i18n workflow added.');
    } else {
      console.log('User declined to add Ninja i18n workflow.');
    }
  } else {
    console.log('Ninja i18n workflow is already adopted.');
  }
}

Contributing

Contributions are highly appreciated! Whether it's feature requests, bug reports, or pull requests, please feel free to contribute. Check out our Discord for community discussions and updates.

FAQs

Package last updated on 21 Jun 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