1.0.2 • Published 9 years ago

charmed v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Charmed

This utility converts characters to and from escaped HTML entities, ascii values, unicode characters, Javascript Character Codes, and simplified versions. Most conversions are reversible.

Please contribute! This is released under the MIT license.

#Usage

var Charmed = require( 'charmed' );
var charmed = Charmed( {
	ascii: true,
	html: true,
	raw: true,
	simple: false,
	unicode: true,
	dotnet: false,
	disablewarning: false
} );
var convertedText = charmed.toHtml( textToConvert );

#Configuration ##Charmed( options ) Default configuration is specified above. Nothing need be passed.

#Conversions Each method below will convert only the discovered character types of the source type to the equivalent characters of the target type.

###charmed.asciiToHtml( string ) ###charmed.asciiToRaw( string ) ###charmed.asciiToSimple( string ) ###charmed.asciiToUnicode( string ) ###charmed.asciiToDotnet( string )

###charmed.htmlToAscii( string ) ###charmed.htmlToRaw( string ) ###charmed.htmlToSimple( string ) ###charmed.htmlToUnicode( string ) ###charmed.htmlToDotnet( string )

###charmed.rawToAscii( string ) ###charmed.rawToHtml( string ) ###charmed.rawToSimple( string ) ###charmed.rawToUnicode( string ) ###charmed.rawToDotnet( string )

###charmed.simpleToAscii( string ) ###charmed.simpleToHtml( string ) ###charmed.simpleToRaw( string ) ###charmed.simpleToUnicode( string ) ###charmed.simpleToDotnet( string )

###charmed.unicodeToAscii( string ) ###charmed.unicodeToHtml( string ) ###charmed.unicodeToRaw( string ) ###charmed.unicodeToSimple( string ) ###charmed.unicodeToDotnet( string )

###charmed.dotnetToAscii( string ) ###charmed.dotnetToHtml( string ) ###charmed.dotnetToRaw( string ) ###charmed.dotnetToSimple( string ) ###charmed.dotnetToUnicode( string )

#Convenience Methods ###charmed.toHtml( string ) Converts all configured character types to their equivalent escaped HTML entitites.

###charmed.toAscii( string ) Converts all configured character types to their ASCII character equivalents.

###charmed.toUnicode( string ) Converts all configured character types to their unicode (\uNNNN) equivalents.

###charmed.toDotnet( string ) Converts all configured character types to their .net-style unicode (%uNNNN) equivalents.

###charmed.toRaw( string ) Converts all configured character types to the raw characters described by their escaped values.

###charmed.toSimple( string ) Converts all configured character types to simplified versions of those characters, where available, and the raw values where they cannot be simplified. Should not be reversed.

#The MIT License (MIT)

Copyright (c) 2014 iConstituent, LLC

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.

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.2.9

9 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago