Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmitriigaidarji/cypher-beautifier
Beautify your Cypher queries
https://github.com/dmitriigaidarji/cypher-beautifier
beautify cypher neo4j
Last synced: 2 months ago
JSON representation
Beautify your Cypher queries
- Host: GitHub
- URL: https://github.com/dmitriigaidarji/cypher-beautifier
- Owner: dmitriigaidarji
- License: gpl-3.0
- Created: 2024-09-22T15:11:26.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-09T09:50:38.000Z (3 months ago)
- Last Synced: 2024-10-11T12:09:59.095Z (3 months ago)
- Topics: beautify, cypher, neo4j
- Language: TypeScript
- Homepage: https://cypher.gaidarji.com/
- Size: 132 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cypher Beautifier
[![HitCount](https://hits.dwyl.com/dmitriigaidarji/cypher-beautifier.svg)](https://hits.dwyl.com/dmitriigaidarji/cypher-beautifier)
A simple NPM package that formats and beautifies Cypher queries for improved readability
### NPM
[![https://nodei.co/npm/cypher-beautifier.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/cypher-beautifier.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/cypher-beautifier)
### Installation
```bash
npm install cypher-beautifier
```### Usage
```typescript jsx
import beautifyCypher from "cypher-beautifier";const query = `
match (n) where n.name = "Bob" return n limit 1
`;const formatted = beautifyCypher(query);
console.log(formatted);
/*
MATCH (n)
WHERE n.name = "Bob"
RETURN n
LIMIT 1
*/
```### API
```typescript
interface IProps {
parseStrings?: boolean;
}
declare function beautifyCypher(query: string, options?: IProps): string;
export default beautifyCypher;
```| Option | Type | Description | Default |
| ------------ | --------- | --------------------------------------------------------- | ------- |
| parseStrings | `boolean` | If `true` formats code inside quotation marks `'` and `"` | `false` |