Socket
Socket
Sign inDemoInstall

prepend-to-lines

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prepend-to-lines

Prepends a string to each line of another string.


Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

prepend-to-lines

License Sponsor prepend-to-lines
Build status Commits since v1.0.2 Last commit Issues
Latest version on npm Dependents Downloads

Prepends a string to each line of another string.

Installation

prepend-to-lines on npm

npm install --save prepend-to-lines@^1.0.2

prepend-to-lines on Yarn

yarn add prepend-to-lines@^1.0.2

@jaid/prepend-to-lines on GitHub Packages
(if configured properly)

npm install --save @jaid/prepend-to-lines@^1.0.2

Example

import prependToLines from "prepend-to-lines"

const text = "I\nwant\nto\nbe\na\nMarkdown\nlist"
const result = prependToLines(text, "- ")

const linesArray = ["Hello", "world"]
const result2 = prependToLines(linesArray, "x")

const result3 = prependToLines("Without linebreaks", "* ")

Variable result will be:

"- I\n- want\n- to\n- be\n- a\n- Markdown\n- list"

Variable result2 will be:

"xHello\nxworld"

Variable result3 will be:

"* Without linebreaks"

Development

Setting up:

git clone git@github.com:jaid/prepend-to-lines.git
cd prepend-to-lines
npm install

Testing:

npm run test:dev

Testing in production environment:

npm run test

License

MIT License
Copyright © 2020, Jaid <jaid.jsx@gmail.com> (https://github.com/jaid)

FAQs

Package last updated on 27 Mar 2020

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