JSPM

resolve-indent

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q26626F
  • License MIT

Split code block by indent

Package Exports

  • resolve-indent

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (resolve-indent) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

resolve-indent

NPM version NPM download Build Status: Linux

Split code block by indent.

Installation

npm i -S resolve-indent

Example

You have a source file:

import re
for test_string in ['555-1212', 'ILL-EGAL']:
    if re.match(r'^\d{3}-\d{4}$', test_string):
        print test_string, 'is a valid US local phone number'
    else:
        print test_string, 'rejected'
parents, babies = (1, 1)
while babies < 100:
    print 'This generation has {0} babies'.format(babies)
    parents, babies = (babies, parents + babies)

You compile the code:

import resolveIndent from 'indent-resolve'
resolveIndent(code)

You got the output:

[
  "import re",

  "for test_string in ['555-1212', 'ILL-EGAL']:\n    if re.match(r'^d{3}-d{4}$', test_string):\n        print test_string, 'is a valid US local phone number'\n    else:\n        print test_string, 'rejected'\",

  "parents, babies = (1, 1)",

  "while babies < 100:\n    print 'This generation has {0} babies'.format(babies)\n    parents, babies = (babies, parents + babies)"
]

License

MIT © EGOIST