Normalize Line Endings
file.normalize_line_endings
Overview
You send inline UTF-8 text or a UTF-8 file_ref. We rewrite CR, LF, and CRLF to one target sequence, report how many of each we saw, and drop a UTF-8 BOM from logical text while telling you it was there. Output stays inline up to 1 MiB and becomes a managed file above that. This is not encoding detection, whitespace formatting, or a binary rewrite.
Silent newline conversion hides whether a file used CR, LF, or CRLF and breaks later diffs.
Reliability
A second call with the same target is a no-op on the logical text. ENCODING_INVALID — trigger: file_ref is not valid UTF-8; retryable: no; next: run file.detect_text_encoding. ITEM_LIMIT_EXCEEDED — trigger: the UTF-8 file exceeds 5 MiB; retryable: no; next: split the file.
Context footprint
Inline text plus counts, or a managed file above 1 MiB. A successful call costs 1 execution credit.
When to use it
When decoded UTF-8 text must have one declared newline before a later compare or commit.
When the bytes are not UTF-8, or you need encoding detection rather than newline rewrite.
Scope
Non-goals
- Does not detect or convert character encodings
- Does not reformat whitespace or wrap lines
- Does not rewrite binary files
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 5 MiB | Skill and platform maximum |
| Maximum total input size | 5 MiB | Skill maximum |
| Maximum number of input files | 1 | Skill maximum |
| Maximum generated artifact size | 5 MiB | Skill maximum |
| Maximum number of generated files | 1 | Skill maximum |
How we handle your data
What this means
This skill may temporarily store files or intermediate data only to complete execution. Temporary data is protected and automatically deleted.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Temporary execution only storage
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | No | Inline UTF-8 text to rewrite; omit it when file_ref is set and never send both. |
| file_ref | string | No | Tenant-scoped UTF-8 text file up to 5 MiB; omit it when inline text is set and never send both. |
| target | string | No | Target newline: LF, CRLF, or CR. Omit this field to apply LF. |
| preserveFinalNewline | boolean | No | When true, keep a final terminator if the source had one. Omit it for true. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | No | Normalized logical text without a UTF-8 BOM when utf8ByteSize is at most 1 MiB. |
| fileRef | string | No | Managed UTF-8 file when the normalized payload exceeds 1 MiB; omitted for inline results. |
| target | string | Yes | Applied target sequence, one of LF, CRLF, or CR. |
| preserveFinalNewline | boolean | Yes | Whether a final terminator was kept when the source had one. |
| inputHadBom | boolean | Yes | True when a UTF-8 BOM was present and omitted from logical text. |
| crlfCount | integer | Yes | How many CRLF sequences were present in the source. |
| crCount | integer | Yes | How many lone CR sequences were present in the source. |
| lfCount | integer | Yes | How many lone LF sequences were present in the source. |
| utf8ByteSize | integer | Yes | UTF-8 byte size of the logical output without a BOM. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"file.normalize_line_endings","input":{"text":"a\r\nb\n"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("file.normalize_line_endings", {"text":"a\r\nb\rc\n"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| ENCODING_INVALID | 400 | No | The request payload failed this skill's input validation. |
| ITEM_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not detect or convert character encodings
- Does not reformat whitespace or wrap lines
- Does not rewrite binary files
- Guessing a legacy code page
- Pretty-printing source
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "file.normalize_line_endings",
"input": {
"text": "a\r\nb\rc\n"
}
}Examples
Mixed endings become LF
{
"text": "a\r\nb\rc\n"
}{
"preserveFinalNewline": true,
"utf8ByteSize": 6,
"text": "a\nb\nc\n",
"inputHadBom": false,
"crCount": 1,
"target": "LF",
"lfCount": 1,
"crlfCount": 1
}UTF-8 BOM is reported and stripped
{
"text": "x\n"
}{
"preserveFinalNewline": true,
"utf8ByteSize": 2,
"text": "x\n",
"inputHadBom": true,
"crCount": 0,
"target": "LF",
"lfCount": 1,
"crlfCount": 0
}Recommended use cases
- Normalize mixed CR/LF extracts before a later UTF-8 diff
- Force CRLF on a checkout that arrived with lone CR
Avoid for
- Guessing a legacy code page
- Pretty-printing source
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.