🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

overlap

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

overlap

Overlap two strings that contain new lines. Useful for ASCII drawings.

1.5.0
Source
npm
Version published
Weekly downloads
1.9K
46.31%
Maintainers
1
Weekly downloads
 
Created
Source

Overlap

Overlap two strings that contain new lines. Useful for ASCII drawings.

Installation

$ npm install overlap

Example

var Overlap = require("overlap")
  , Couleurs = require("couleurs")()
  , a =
    Couleurs.bg("+--------------+\n", 142, 68, 173) +
    Couleurs.bg("|              |\n", 142, 100, 200) +
    Couleurs.bg("|   " + Couleurs.fg("Hello World", 255, 255, 0), 142, 68, 173) + "  |\n" +
    Couleurs.bg("|              |\n", 142, 100, 250) +
    Couleurs.bg("|              |\n", 142, 68, 173) +
    Couleurs.bg("|              |\n", 142, 68, 173) +
    Couleurs.bg("|  " + Couleurs.fg("Hello World", 0, 255, 0), 142, 68, 173) + Couleurs.bg(" |\n", 142, 68, 173) +
    Couleurs.bg("|              |\n", 231, 76, 60) +
    Couleurs.bg("+--------------+", 231, 76, 60)
  , b =
    Couleurs.bold("+-------+\n") +
    Couleurs.bg("|       |\n", 192, 57, 43) +
    Couleurs.bg("|       |\n", 230, 126, 34) +
    Couleurs.italic("+-------+")
  ;

console.log(Overlap({
    who: a
  , with: b
  , where: {
        x: 10
      , y: 1
    }
}));

Result:

Example

Documentation

Overlap(options)

Overlaps two strings.

Params

  • Object options: An object containing the following fields:
  • who (String): The first string.
  • with (String): The second string.
  • where (Object): The second string position:
    • x (Number): The position on x axis.
    • y (Number): The position on y axis.

Return

  • String The result string.

How to contribute

  • File an issue in the repository, using the bug tracker, describing the contribution you'd like to make. This will help us to get you started on the right foot.
  • Fork the project in your account and create a new branch: your-great-feature.
  • Commit your changes in that branch.
  • Open a pull request, and reference the initial issue in the pull request message.

Changelog

See the releases page.

License

See the LICENSE file.

Keywords

ascii

FAQs

Package last updated on 30 Dec 2014

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