Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
to-space-case
Advanced tools
The 'to-space-case' npm package is a utility that converts strings to space case. Space case is a format where words are separated by spaces, and it is useful for creating human-readable strings from various other formats like camelCase, snake_case, etc.
Convert camelCase to space case
This feature converts a camelCase string to space case, making it more readable by separating words with spaces.
const toSpaceCase = require('to-space-case');
const result = toSpaceCase('camelCaseString');
console.log(result); // 'camel case string'
Convert snake_case to space case
This feature converts a snake_case string to space case, replacing underscores with spaces.
const toSpaceCase = require('to-space-case');
const result = toSpaceCase('snake_case_string');
console.log(result); // 'snake case string'
Convert kebab-case to space case
This feature converts a kebab-case string to space case, replacing hyphens with spaces.
const toSpaceCase = require('to-space-case');
const result = toSpaceCase('kebab-case-string');
console.log(result); // 'kebab case string'
The 'change-case' package provides a comprehensive set of functions for converting strings between different cases, including camelCase, snake_case, kebab-case, and more. It offers more versatility compared to 'to-space-case' as it supports multiple case transformations.
Lodash is a utility library that offers a wide range of functions for manipulating arrays, objects, and strings. It includes methods like _.camelCase, _.snakeCase, and _.kebabCase, which can be used to convert strings between different cases. While it is more feature-rich, it is also larger in size compared to 'to-space-case'.
Voca is a versatile string manipulation library that provides functions for changing string cases, among other string operations. It includes methods like voca.camelCase, voca.snakeCase, and voca.kebabCase, making it a good alternative to 'to-space-case' with additional string manipulation capabilities.
Convert a string to a space case.
$ npm install to-space-case
var space = require('to-space-case');
space('camelCase'); // "camel case"
space('snake_case'); // "snake case"
space('dot.case'); // "dot case"
space('-RAnDom -jUNk$__loL!') // "random junk lol"
Returns the string
converted to space case.
The MIT License (MIT)
Copyright © 2016, Ian Storm Taylor
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Convert a string to space case.
The npm package to-space-case receives a total of 559,077 weekly downloads. As such, to-space-case popularity was classified as popular.
We found that to-space-case demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.