# toidentifier

[![NPM Version](https://img.shields.io/npm/v/toidentifier.svg)](https://npmjs.org/package/toidentifier) [![NPM Downloads](https://img.shields.io/npm/dm/toidentifier.svg)](https://npmjs.org/package/toidentifier) [![Build Status](https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci)](https://github.com/component/toidentifier?query=workflow%3Aci) [![Test Coverage](https://img.shields.io/codecov/c/github/component/toidentifier.svg)](https://codecov.io/gh/component/toidentifier)

> Convert a string of words to a JavaScript identifier

## Install

This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```bash
$ npm install toidentifier
```

## Example

```js
var toIdentifier = require('toidentifier')

console.log(toIdentifier('Bad Request'))
// => "BadRequest"
```

## API

This CommonJS module exports a single default function: `toIdentifier`.

### toIdentifier(string)

Given a string as the argument, it will be transformed according to the following rules and the new string will be returned:

1. Split into words separated by space characters (`0x20`).
2. Upper case the first character of each word.
3. Join the words together with no separator.
4. Remove all non-word (`[0-9a-z_]`) characters.

## License

[MIT](https://github.com/pingponglabs/mediamagic-platform/blob/main/services/graphql-gateway/node_modules/toidentifier/LICENSE/README.md)

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mediamagic.dev/product-docs/services/graphql-gateway/node_modules/toidentifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
