Squidex
  • Welcome to Squidex
  • Getting Started
    • Squidex Cloud
    • Installation Instructions
      • Platforms
        • Install on Kubernetes
        • Install on AWS (Deprecated)
        • Install on AWS EC2 using Docker
        • Install on Azure
        • Install on Azure using ARM
        • Install on Google Cloud Platform (GCP)
        • Install on Docker
        • Install on Heroku
        • Install on IIS
        • Install on Render
        • Install on Vultr
      • Configuration
        • Deploying the Image Resizer Service
      • Troubleshooting and Support
        • Diagnose Runtime Issues
        • Restoring Deleted Apps
      • Install Identity (Deprecated)
      • External Identity Providers
        • Azure AD (OAuth) with Squidex
    • Contributing and Developing
      • Building
      • Developing
      • Extensions
        • Custom Rule Action
      • Contributing
      • Architecture
      • Translating
      • Squidex Docs Program
    • Roadmap
    • Quick Start Guides
      • Vue.js Blog with Squidex
      • React.js Blog with Squidex
      • Angular Blog with Squidex
  • Documentation
    • Introduction and Use Case
    • Concepts
      • Apps
      • Teams
      • Schemas
        • Field Rules
      • Content
        • Scheduled Publishing
      • Assets
        • Querying Assets
      • Localization
      • Migrations
      • Roles & Permissions
      • Rules
        • Publish an Event to Azure Queues using Rules
        • Populate Elasticsearch Index
      • Backups
      • Subscriptions
        • App Subscriptions v/s Team Subscriptions
      • Notifications
      • Dashboard
      • Workflows
    • Software Development Kits
      • TypeScript
      • .NET
        • Version v14 (and Earlier)
        • Version v15 (and Later)
      • PHP
      • Java
    • Developer Guides
      • API
        • Authentication
        • Postman
        • Queries
        • Assets
      • Automation Tools (CLI)
      • Scripting
        • Scripting Helper Methods
      • Embed Content
      • Custom Workflows
      • Custom Editors
      • Custom Sidebars
      • Preview Content
      • Rule Formatting
        • Simple
        • Script
        • Liquid
      • Tutorials
        • Building a Blog with Squidex and Next.js
  • Next
    • Squidex 3.0: API Compatibility
Powered by GitBook
On this page

Was this helpful?

  1. Documentation
  2. Developer Guides
  3. Scripting

Scripting Helper Methods

Helper Methods for Scripting

The following helper methods are not part of the ES5 JavaScript standard, but they are very helpful for a lot of use cases.

Name
Description

html2Text(text)

Converts a HTML string to plain text.

markdown2Text(text)

Converts a markdown string to plain text.

formatDate(date,pattern)

Formats a JavaScript date object using the specified pattern.

formatTime(date,pattern)

Same as formatDate.

wordCount(text)

Counts the number of words in a text. Useful in combination with html2Text or markdown2Text.

characterCount(text)

Counts the number of characters in a text. Useful in combination with html2Text or markdown2Text.

toCamelCase(text)

Converts a text to camelCase.

toPascalCase(text)

Converts a text to PascalCase.

sha256(text)

Calculate the SHA256 hash from a given string. Use this method for hashing passwords.

md5(text)

Calculate the MD5 hash from a given string. Use this method for hashing passwords, when backwards compatibility is important.

slugify(text)

Calculates the slug of a text by removing all special characters and whitespaces to create a friendly term that can be used for SEO-friendly URLs.

PreviousScriptingNextEmbed Content

Last updated 2 years ago

Was this helpful?