Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/facebook/jscodeshift
/ functions
Functions
135 in github.com/facebook/jscodeshift
⨍
Functions
135
◇
Types & classes
6
↓ 41 callers
Function
createTempFileWith
(content, filename, extension)
utils/testUtils.js:23
↓ 35 callers
Function
readFile
(path)
bin/__tests__/jscodeshift-test.js:25
↓ 24 callers
Method
forEach
* Executes callback for each node/path in the collection. * * @param {function} callback * @return {Collection} The collection itself
src/Collection.js:73
↓ 24 callers
Function
run
(args, stdin, cwd)
bin/__tests__/jscodeshift-test.js:29
↓ 22 callers
Method
map
* Executes the callback for every path in the collection and returns a new * collection from the return values (which must be paths). * * The
src/Collection.js:117
↓ 21 callers
Method
nodes
* Returns an array of AST nodes in this collection. * * @return {Array}
src/Collection.js:158
↓ 20 callers
Function
createTransformWith
(content, ext='.js')
utils/testUtils.js:37
↓ 19 callers
Method
toSource
(options)
src/Collection.js:173
↓ 16 callers
Method
get
* Proxies to NodePath#get of the first path. * * @param {string|number} ...fields
src/Collection.js:210
↓ 15 callers
Method
filter
* Returns a new collection containing the nodes for which the callback * returns true. * * @param {function} callback * @return {Collectio
src/Collection.js:63
↓ 11 callers
Function
done
()
src/Runner.js:101
↓ 11 callers
Method
getTypes
* Returns the type(s) of the collection. This is only used for unit tests, * I don't think other consumers would need it. * * @return {Array<
src/Collection.js:227
↓ 10 callers
Function
core
* Main entry point to the tool. The function accepts multiple different kinds * of arguments as a convenience. In particular the function accepts eit
src/core.js:42
↓ 10 callers
Method
every
* Tests whether all paths pass the test implemented by the provided callback. * * @param {function} callback * @return {boolean}
src/Collection.js:98
↓ 9 callers
Function
expression
(template/*, ...nodes*/)
src/template.js:131
↓ 7 callers
Function
updateStatus
(status, file, msg)
src/Worker.js:108
↓ 6 callers
Function
callback
()
src/argsParser.js:95
↓ 6 callers
Function
getModuleToTransform
()
src/__tests__/testUtils-test.js:20
↓ 6 callers
Method
some
* Tests whether at-least one path passes the test implemented by the provided callback. * * @param {function} callback * @return {boolean}
src/Collection.js:86
↓ 5 callers
Method
at
* Returns a new collection containing only the element at position index. * * In case of a negative index, the element is taken from the end:
src/Collection.js:195
↓ 5 callers
Function
getFileContent
(filePath)
utils/testUtils.js:46
↓ 5 callers
Method
paths
()
src/Collection.js:162
↓ 5 callers
Function
splice
(arr, element, replacement)
src/template.js:16
↓ 4 callers
Function
matchNode
* Checks whether needle is a strict subset of haystack. * * @param {*} haystack Value to test. * @param {*} needle Test function or value to look f
src/matchNode.js:21
↓ 4 callers
Function
transform
(transformFile)
src/Runner.js:218
↓ 3 callers
Function
defineInlineTest
(module, options, input, expectedOutput, testName)
src/testUtils.js:142
↓ 3 callers
Function
fromPaths
* Creates a new collection from an array of node paths. * * If type is passed, it will create a typed collection if such a collection * exists. The
src/Collection.js:315
↓ 3 callers
Function
getHelpText
(options)
src/argsParser.js:48
↓ 3 callers
Function
getTransformForParser
(parser)
src/__tests__/Worker-test.js:55
↓ 3 callers
Function
isOption
(value)
src/argsParser.js:121
↓ 3 callers
Function
register
(methodName, type)
src/__tests__/Collection-test.js:177
↓ 3 callers
Function
throwError
* Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root d
src/argsParser.js:8
↓ 3 callers
Function
toArray
(value)
src/collections/Node.js:123
↓ 2 callers
Function
_toTypeArray
(value)
src/Collection.js:271
↓ 2 callers
Function
applyTransform
(module, options, input, testOptions = {})
src/testUtils.js:15
↓ 2 callers
Function
defineTest
* Handles some boilerplate around defining a simple jest/Jasmine test for a * jscodeshift transform.
src/testUtils.js:129
↓ 2 callers
Function
enrichCore
* The ast-types library * @external astTypes * @see {@link https://github.com/benjamn/ast-types}
src/core.js:154
↓ 2 callers
Function
extensionForParser
(parser)
src/testUtils.js:72
↓ 2 callers
Function
fromAST
* Returns a collection from a node, node path, array of nodes or array of node * paths. * * @ignore * @param {Node|NodePath|Array} source * @retu
src/core.js:56
↓ 2 callers
Function
getSourceFile
()
src/__tests__/Worker-test.js:66
↓ 2 callers
Function
isNode
(value)
src/matchNode.js:36
↓ 2 callers
Function
lineBreak
(str)
src/Runner.js:25
↓ 2 callers
Function
next
()
src/Runner.js:237
↓ 2 callers
Function
parse
()
src/__tests__/argsParser-test.js:66
↓ 2 callers
Function
run
(data)
src/Worker.js:140
↓ 2 callers
Function
run
(paths, options)
bin/jscodeshift.js:168
↓ 2 callers
Function
runInlineTest
(module, options, input, expectedOutput, testOptions)
src/testUtils.js:58
↓ 2 callers
Function
setup
(tr, babel)
src/Worker.js:54
↓ 2 callers
Function
statement
(/*template, ...nodes*/)
src/template.js:127
↓ 2 callers
Function
typeFilter
(type)
src/__tests__/Collection-test.js:160
↓ 1 callers
Function
_getSupertypeNames
(type)
src/Collection.js:283
↓ 1 callers
Function
_inferTypes
* Given a set of paths, this infers the common types of all paths. * @private * @param {Array} paths An array of paths. * @return {Type} type An AS
src/Collection.js:248
↓ 1 callers
Function
cleanLocation
(node)
src/template.js:20
↓ 1 callers
Function
defineSnapshotTest
(module, options, input, testName)
src/testUtils.js:152
↓ 1 callers
Function
defineSnapshotTestFromFixture
* Handles file-loading boilerplates, using same defaults as defineTest
src/testUtils.js:165
↓ 1 callers
Function
dirFiles
(dir, callback, acc)
src/Runner.js:97
↓ 1 callers
Function
ensureStatement
(node)
src/template.js:27
↓ 1 callers
Function
free
()
src/Worker.js:104
↓ 1 callers
Function
fromSource
(source, options)
src/core.js:75
↓ 1 callers
Function
getAllFiles
(paths, filter)
src/Runner.js:138
↓ 1 callers
Function
getUniqueVarName
()
src/template.js:105
↓ 1 callers
Function
getVistor
(varNames, nodes)
src/template.js:35
↓ 1 callers
Function
hasConflictingRegistration
(methodName, type)
src/Collection.js:428
↓ 1 callers
Function
installTypedMethod
(methodName)
src/Collection.js:400
↓ 1 callers
Method
isOfType
* Returns true if this collection has the type 'type'. * * @param {Type} type * @return {boolean}
src/Collection.js:237
↓ 1 callers
Function
plugin
()
src/__tests__/core-test.js:67
↓ 1 callers
Function
prepareJscodeshift
(options)
src/Worker.js:48
↓ 1 callers
Function
prepareOptions
(options)
src/argsParser.js:90
↓ 1 callers
Function
renameFileTo
(oldPath, newFilename, extension = '')
utils/testUtils.js:15
↓ 1 callers
Function
replaceNodes
(src, varNames, nodes, parser)
src/template.js:98
↓ 1 callers
Function
report
({file, msg})
src/Runner.js:65
↓ 1 callers
Function
report
(file, msg)
src/Worker.js:113
↓ 1 callers
Function
runSnapshotTest
(module, options, input)
src/testUtils.js:45
↓ 1 callers
Function
runTest
* Utility function to run a jscodeshift script within a unit test. This makes * several assumptions about the environment: * * - `dirName` contains
src/testUtils.js:101
↓ 1 callers
Function
showFileStats
(fileStats)
src/Runner.js:79
↓ 1 callers
Function
showStats
(stats)
src/Runner.js:89
↓ 1 callers
Function
statements
(template/*, ...nodes*/)
src/template.js:111
↓ 1 callers
Function
test
(testCases)
src/utils/__tests__/intersection-test.js:12
↓ 1 callers
Function
test
(testCases)
src/utils/__tests__/union-test.js:12
↓ 1 callers
Function
test
(testCases)
src/__tests__/argsParser-test.js:59
↓ 1 callers
Function
trimStackTrace
(trace)
src/Worker.js:124
↓ 1 callers
Function
validateOptions
(parsedOptions, options)
src/argsParser.js:71
Function
addIgnoreFromFile
* Adds ignore patterns by reading files * @param {String|Array<String>} input - the paths to the ignore config files
src/ignoreFiles.js:43
Function
addIgnoreFromInput
* Adds ignore patterns directly from function input * @param {String|Array<String>} input - the ignore patterns
src/ignoreFiles.js:31
Function
addIgnorePattern
* Add glob patterns to ignore matched files and folders. * Creates glob patterns to approximate gitignore patterns. * @param {String} val - the glob
src/ignoreFiles.js:14
Function
addition
(a, b)
src/__testfixtures__/test-async-transform.output.js:1
Function
addition
(a, b)
src/__testfixtures__/test-sync-transform.output.js:1
Function
asyncExpression
(template/*, ...nodes*/)
src/template.js:152
Method
bar
()
sample/__testfixtures__/reverse-identifiers.input.js:7
Function
concatAll
(arrays)
src/Runner.js:69
Method
constructor
* @param {Array} paths An array of AST paths * @param {Collection} parent A parent collection * @param {Array} types An array of types all the p
src/Collection.js:40
Function
egasseMteg
()
sample/__testfixtures__/typescript/reverse-identifiers.output.ts:7
Function
empty
()
src/Worker.js:117
Function
error
(msg, verbose)
src/Runner.js:60
Function
formatOption
(option)
src/argsParser.js:16
Function
fromNodes
* Creates a new collection from an array of nodes. This is a convenience * method which converts the nodes to node paths first and calls * * Col
src/Collection.js:336
Method
getAST
()
src/Collection.js:166
Function
getMessage
()
sample/__testfixtures__/typescript/reverse-identifiers.input.ts:7
Function
identifierMethod
()
src/__tests__/Collection-test.js:119
Method
length
* Returns the number of elements in this collection. * * @return {number}
src/Collection.js:149
next →
1–100 of 135, ranked by callers