# trimstring **Repository Path**: mirrors_iansinnott/trimstring ## Basic Information - **Project Name**: trimstring - **Description**: 🔪 Neatly trim template strings - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # trimstring [![Build Status](https://img.shields.io/circleci/project/iansinnott/trimstring.svg)](https://circleci.com/gh/iansinnott/trimstring) [![trimstring on NPM](https://img.shields.io/npm/v/trimstring.svg)](https://www.npmjs.com/package/trimstring) > 🔪 Neatly trim template strings ## Install ``` $ npm install --save trimstring ``` ## Usage ```js const trimstring = require('trimstring'); const genHtml = props => { return trimstring(` ${props.title} ${props.body} `); }; // Leading whitespace and trailing newlines will be trimmed. genHtml({ title: 'Trimstring', body: 'This is my favorite library!' }); //=> ` Trimstring This is my favorite library! ` ``` ## API ### trimstring(templateString) #### templateString Type: `string` A multiline string for trimming. **NOTE:** If your string does not need multiple lines then trimstring probably won't help you. The core use of this library is for creating strings without leading whitespace or trailing/leading newlines but allowing you to still write your code in a readable way. ## License MIT © [Ian Sinnott](http://iansinnott.com)