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

oneline

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oneline - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

LICENSE

35

package.json
{
"name": "oneline",
"version": "0.0.0",
"description": "A repository/library to aid in the discovery and reuse of very small pieces of code - oneliners",
"main": "index.js",
"version": "1.0.0",
"description": "Write nice template literals with newlines, but format as a single-line string",
"main": "oneline.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "node test.js"
},
"engines": {
"node" : ">=6.0.0"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/halhenke/oneline.git"
"url": "git+ssh://git@github.com/rexxars/oneline.git"
},
"files": [
"oneline.js",
"test.js"
],
"keywords": [
"modular",
"oneline"
"template-literal",
"template-string",
"tagged",
"string",
"multiline"
],
"publishConfig": {
"tag": "next"
},
"author": "Hal Henke",
"license": "ISC",
"author": "Espen Hovlandsdal <espen@hovlandsdal.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/halhenke/oneline/issues"
"url": "https://github.com/rexxars/oneline/issues"
},
"homepage": "https://github.com/halhenke/oneline#readme"
"homepage": "https://github.com/rexxars/oneline#readme"
}

34

README.md

@@ -1,11 +0,33 @@

# What is this?
# oneline
Inspired by discussion debate around "extreme modularity" and the creation/use of packages that might consist of only a single line of code. See [here](https://github.com/sindresorhus/ama/issues/10)
Write nice template literals with newlines, but format as a single-line string.
Trims leading/trailing whitespace and replaces all newlines and subsequent whitespace with a single space.
Basically the idea is that by bundling these micro-packages into a lodash style utility library they will be more discoverable to package consumers i.e. you might not even think to look for a module that checks if a number is `-0` on npm but if you know theres a library that might contain such code you'd be more likely to check there. And over time you might have more of an idea of what already already exists. All modules will be available as individual npm packages, again a la lodash.
[![npm version](https://img.shields.io/npm/v/oneline.svg?style=flat-square)](http://browsenpm.org/package/oneline)[![Build Status](https://img.shields.io/travis/rexxars/oneline/master.svg?style=flat-square)](https://travis-ci.org/rexxars/oneline)
I'm not sure if this type of programming will be particularly useful or will lead to the downfall of modern civilization but hopefully a library like this might mitigate some of the potential downsides of this type of fine grained modularity while maintaining the theoretical advantages.
## Installing
# Placeholder for now
```
npm install --save oneline
```
Because I only thought of this half an hour ago...
## Basic usage
```js
const oneline = require('oneline')
const url = 'https://docs.npmjs.com/'
const message = oneline`
It's a fine day to write a long, verbose string.
It could contain all sorts of expressions, let's for instance
inject a URL, say to the NPM docs: ${url}. In the end, this will
all result in a single line of text.
`
console.log(message)
// It's a fine day to write a long, verbose string. It could contain all sorts of expressions, let's for instance inject a URL, say to the NPM docs: https://docs.npmjs.com/. In the end, this will all result in a single line of text.
```
## License
MIT © [Espen Hovlandsdal](https://espen.codes/)
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